Skip to content

Commit 75650fe

Browse files
committed
feat: ✨ seo stuff
1 parent 7587da0 commit 75650fe

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

src/app/manifest.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { MetadataRoute } from "next";
2+
3+
export default function manifest(): MetadataRoute.Manifest {
4+
return {
5+
name: "Jacob Moy",
6+
short_name: "Jacob Moy",
7+
description: "Jacob Moy's portfolio website.",
8+
start_url: "/",
9+
display: "standalone",
10+
background_color: "#fff",
11+
theme_color: "#fff",
12+
icons: [
13+
{
14+
src: "/favicon.ico",
15+
sizes: "any",
16+
type: "image/x-icon",
17+
},
18+
],
19+
};
20+
}

src/app/robots.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { MetadataRoute } from "next";
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: {
6+
userAgent: "*",
7+
allow: "/",
8+
disallow: "/private/",
9+
},
10+
sitemap: "https://jacobmoy.com/sitemap.xml",
11+
};
12+
}

src/app/sitemap.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { MetadataRoute } from "next";
2+
import { posts } from "@/utils/posts";
3+
4+
export default function sitemap(): MetadataRoute.Sitemap {
5+
const allPosts = posts.getPosts();
6+
7+
const blogs = allPosts.map((post) => ({
8+
url: `https://jacobmoy.com/blog/${post.slug}`,
9+
lastModified: new Date(post.date).toISOString().split("T")[0],
10+
}));
11+
12+
const routes = ["", "/blog", "/quick-links"].map((route) => ({
13+
url: `https://jacobmoy.com${route}`,
14+
lastModified: new Date().toISOString().split("T")[0],
15+
}));
16+
17+
return [...routes, ...blogs];
18+
}

0 commit comments

Comments
 (0)