-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
132 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> | ||
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com --> | ||
<url> | ||
<loc>https://qhan.wang/</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>1.00</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/projects</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/next-mdx-blog</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/ssr-timezone</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-gradient-circle</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/local-nginx-docker</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/dnd-kit-ant-table</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/test-playwright-auth</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-aspect-ratio</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-centered</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/react-component-lifecycle</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/cursor-position</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/canvas-gen-thumbnail</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-checkbox-beautify</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-custom-scrollbar</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/css-nth-child</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
<url> | ||
<loc>https://qhan.wang/posts/regexp</loc> | ||
<lastmod>2023-10-25T10:37:00+00:00</lastmod> | ||
<priority>0.64</priority> | ||
</url> | ||
</urlset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { MetadataRoute } from "next"; | ||
|
||
import { getAllPosts } from "@/lib/posts"; | ||
|
||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
// 远程获取博客列表 | ||
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]; | ||
} |
e1577dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
qhan – ./
qhan-qhanw.vercel.app
qhan.wang
www.qhan.wang
qhan-git-main-qhanw.vercel.app