Skip to content

Commit

Permalink
SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
gilhanan committed Nov 3, 2023
1 parent dc0c489 commit 145dc30
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://gil-hanan.com/sitemap.xml
30 changes: 30 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { MetadataRoute } from "next";
import { projects } from "@data/projects";

const host = "https://gil-hanan.com";
const lastModified = new Date();

export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: host,
lastModified,
},
{
url: `${host}/projects`,
lastModified,
},
{
url: `${host}/about`,
lastModified,
},
{
url: `${host}/contact`,
lastModified,
},
...projects.map(({ id }) => ({
url: `${host}/projects/${id}`,
lastModified,
})),
];
}

0 comments on commit 145dc30

Please sign in to comment.