Skip to content

Commit

Permalink
Add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
gorbatiukcom committed Apr 7, 2024
1 parent 666a8fa commit 35ce44d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Allow all crawlers
# *
User-agent: *
Allow: /
Allow: /

# Host
Host: https://admiralinterior.com/

# Sitemaps
Sitemap: https://admiralinterior.com/sitemap.xml
4 changes: 4 additions & 0 deletions src/app/portfolio/[projectId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
};
}

export async function generateStaticParams() {
return PortfolioProjects.map((project) => ({ projectId: project.projectId }));
}

export default Project;
43 changes: 43 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { MetadataRoute } from "next";

import { PortfolioProjects } from "@/constants/portfolio";

export default function sitemap(): MetadataRoute.Sitemap {
const portfolio = PortfolioProjects.map((project) => ({
url: `https://admiralinterior.com/portfolio/${project.projectId}`,
lastModified: new Date(),
changeFrequency: "daily" as const,
priority: 0.7,
}));

return [
{
url: "https://admiralinterior.com/",
lastModified: new Date(),
changeFrequency: "daily",
priority: 1,
},
{
url: "https://admiralinterior.com/services",
lastModified: new Date(),
changeFrequency: "daily",
priority: 0.7,
},
{
url: "https://admiralinterior.com/portfolio",
lastModified: new Date(),
changeFrequency: "daily",
priority: 0.7,
},
{
url: "https://admiralinterior.com/contacts",
lastModified: new Date(),
changeFrequency: "daily",
priority: 0.7,
},
...portfolio,
];
}

// yearly monthly weekly
// priority 0.7 — default

0 comments on commit 35ce44d

Please sign in to comment.