diff --git a/site/blog/app/components/Header.tsx b/site/blog/app/components/Header.tsx index a8d26f0..ebd8f83 100644 --- a/site/blog/app/components/Header.tsx +++ b/site/blog/app/components/Header.tsx @@ -13,6 +13,16 @@ const nav = [ /> ), }, + // { + // name: "Notes", + // href: "/notes", + // icon: (props: any) => ( + // + // ), + // }, { name: "Projects", href: "/projects", diff --git a/site/blog/app/robots.ts b/site/blog/app/robots.ts index b3c8c46..53fa654 100644 --- a/site/blog/app/robots.ts +++ b/site/blog/app/robots.ts @@ -5,7 +5,7 @@ export default function robots(): MetadataRoute.Robots { rules: { userAgent: "*", allow: "/", - disallow: "/private/", + // disallow: "/private/", }, sitemap: "https://qhan.wang/sitemap.xml", }; diff --git a/site/blog/app/sitemap.ts b/site/blog/app/sitemap.ts deleted file mode 100644 index be3d480..0000000 --- a/site/blog/app/sitemap.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { MetadataRoute } from "next"; - -import { getAllPosts } from "@/lib/posts"; - -export default async function sitemap(): Promise { - // 远程获取博客列表 - const posts = await getAllPosts(); - - // 转换为博客的 sitemap - const maps: MetadataRoute.Sitemap = posts.map((post) => ({ - url: `https://qhan.wang/posts/${post.slug}`, - lastModified: post.meta.lastModified, - changeFrequency: "weekly", - priority: 0.6, - })); - - // // 加入本地的其他路由页面 - // const routes = ["", "/about", "/blog"].map((route) => ({ - // url: `https://xxx.com${route}`, - // lastModified: new Date().toISOString(), - // })); - - return [ - { - url: "https://qhan.wang", - lastModified: new Date(), - changeFrequency: "weekly", - priority: 1, - }, - { - url: "https://qhan.wang/posts", - lastModified: new Date(), - changeFrequency: "weekly", - priority: 0.8, - }, - { - url: "https://qhan.wang.com/projects", - lastModified: new Date(), - changeFrequency: "weekly", - priority: 0.8, - }, - ...maps, - ]; -} diff --git a/site/blog/app/sitemap.xml b/site/blog/app/sitemap.xml new file mode 100644 index 0000000..1da4cff --- /dev/null +++ b/site/blog/app/sitemap.xml @@ -0,0 +1,93 @@ + + + +https://qhan.wang/ +2023-10-25T10:37:00+00:00 +1.00 + + +https://qhan.wang/posts +2023-10-25T10:37:00+00:00 +0.80 + + +https://qhan.wang/projects +2023-10-25T10:37:00+00:00 +0.80 + + +https://qhan.wang/posts/next-mdx-blog +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/ssr-timezone +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-gradient-circle +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/local-nginx-docker +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/dnd-kit-ant-table +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/test-playwright-auth +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-aspect-ratio +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-centered +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/react-component-lifecycle +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/cursor-position +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/canvas-gen-thumbnail +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-checkbox-beautify +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-custom-scrollbar +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/css-nth-child +2023-10-25T10:37:00+00:00 +0.64 + + +https://qhan.wang/posts/regexp +2023-10-25T10:37:00+00:00 +0.64 + + \ No newline at end of file diff --git a/site/blog/app/sitemap_black.ts b/site/blog/app/sitemap_black.ts new file mode 100644 index 0000000..8b632b5 --- /dev/null +++ b/site/blog/app/sitemap_black.ts @@ -0,0 +1,28 @@ +import { MetadataRoute } from "next"; + +import { getAllPosts } from "@/lib/posts"; + +export default async function sitemap(): Promise { + // 远程获取博客列表 + const posts = await getAllPosts(); + + const domain = `https://qhan.wang`; + + // 转换为博客的 sitemap + const posts_maps: MetadataRoute.Sitemap = posts.map((post) => ({ + url: `${domain}/posts/${post.slug}`, + lastModified: post.meta.lastModified?.toISOString(), + // changeFrequency: "daily", + priority: +(0.8 * 0.8).toFixed(2), + })); + + // 加入本地的其他路由页面 + const route_maps = ["/", "/posts", "/projects"].map((route) => ({ + url: domain + route, + lastModified: new Date().toISOString(), + // changeFrequency: "weekly", + priority: route ? 0.8 : 1, + })); + + return [...route_maps, ...posts_maps]; +}