Skip to content

Commit

Permalink
chore: some SEO stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Jul 17, 2024
1 parent 55289ba commit 39bbfdd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/example-nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Metadata } from 'next';
import Image from 'next/image';

import { GithubLink } from './components/GithubLink';
Expand Down Expand Up @@ -41,7 +42,7 @@ export default async function Home({ searchParams }: { searchParams: object }) {
<div className="bg-white rounded-lg shadow-xl p-8 max-w-4xl w-full">
<header className="mb-8 flex justify-between items-center flex-wrap gap-2">
<h2 className="text-3xl font-bold text-gray-800">
Demo with Next.js SSR
Demo with Next.js
</h2>
<GithubLink className="ml-auto" />
</header>
Expand All @@ -64,3 +65,9 @@ export default async function Home({ searchParams }: { searchParams: object }) {
</main>
);
}

export const metadata: Metadata = {
title: 'state-in-url',
description:
'State management, client components communication and deep links',
};
12 changes: 12 additions & 0 deletions packages/example-nextjs/src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: '*',
allow: '/',
disallow: ['/test/', '/test-ssr/', '/test-ssr-sp/', '/test-use-client/'],
},
sitemap: 'https://state-in-url-asmyshlyaev177.vercel.app/sitemap.xml',
};
}
12 changes: 12 additions & 0 deletions packages/example-nextjs/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MetadataRoute } from 'next';

export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: 'https://state-in-url-asmyshlyaev177.vercel.app/',
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 1,
},
];
}

0 comments on commit 39bbfdd

Please sign in to comment.