Skip to content

Commit

Permalink
fix(GIST-40): setup nextjs seo (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorian-grst authored Sep 6, 2024
1 parent a4e4120 commit d315c47
Showing 3 changed files with 65 additions and 47 deletions.
88 changes: 41 additions & 47 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
import Image from "next/image";
import Image from 'next/image'

import { Metadata } from 'next'

export const metadata: Metadata = {
metadataBase: new URL('https://gists.app'),
keywords: [
'gists',
'app',
'code snippets',
'code sharing',
'developer tools',
'programming',
'collaboration',
'open source',
'project management',
'code editor',
'gist platform',
'coding platform',
'software development',
'team collaboration',
'version control',
'code storage',
],
title: 'Gists App',
openGraph: {
description: 'Gists App is a platform for sharing code snippets and collaborating on projects',
images: [''],
},
}

export default function Home() {
return (
@@ -15,28 +44,13 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
priority
/>
By <Image src="/vercel.svg" alt="Vercel Logo" className="dark:invert" width={100} height={24} priority />
</a>
</div>
</div>

<div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
<Image className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert" src="/next.svg" alt="Next.js Logo" width={180} height={37} priority />
</div>

<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
@@ -47,14 +61,9 @@ export default function Home() {
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Docs{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
Docs <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">-&gt;</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Find in-depth information about Next.js features and API.
</p>
<p className="m-0 max-w-[30ch] text-sm opacity-50">Find in-depth information about Next.js features and API.</p>
</a>

<a
@@ -64,14 +73,9 @@ export default function Home() {
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Learn{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
Learn <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">-&gt;</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
<p className="m-0 max-w-[30ch] text-sm opacity-50">Learn about Next.js in an interactive course with&nbsp;quizzes!</p>
</a>

<a
@@ -81,14 +85,9 @@ export default function Home() {
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Templates{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
Templates <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">-&gt;</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Explore starter templates for Next.js.
</p>
<p className="m-0 max-w-[30ch] text-sm opacity-50">Explore starter templates for Next.js.</p>
</a>

<a
@@ -98,16 +97,11 @@ export default function Home() {
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Deploy{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
Deploy <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">-&gt;</span>
</h2>
<p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
<p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">Instantly deploy your Next.js site to a shareable URL with Vercel.</p>
</a>
</div>
</main>
);
)
}
15 changes: 15 additions & 0 deletions src/app/robot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { MetadataRoute } from 'next'

export default function robots(): MetadataRoute.Robots {
const baseUrl = 'https://gists.app'
return {
rules: [
{
userAgent: '*',
allow: ['/', '/login'],
disallow: ['/mygist/', '/team/'],
},
],
sitemap: `${baseUrl}/sitemap.xml`,
}
}
9 changes: 9 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default async function sitemap() {
const baseUrl = 'https://gists.app'
return [
{
url: baseUrl,
lastModified: new Date(),
},
]
}

0 comments on commit d315c47

Please sign in to comment.