Skip to content

Commit

Permalink
feat(site/blog): add middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
qhanw committed Oct 12, 2024
1 parent d23adfa commit 54a521c
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site/blog/app/(web)/components/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default function Theme() {
const isDark = theme === "dark";

return (
<a
<span
onClick={() => setTheme(isDark ? "light" : "dark")}
className="text-slate-600 dark:text-slate-200 cursor-pointer"
className="text-slate-600 dark:text-slate-300 hover:text-slate-800 dark:hover:text-slate-100 cursor-pointer"
>
<i className={isDark ? "i-ri:sun-fill" : "i-ri:moon-fill"} />
</a>
</span>
);
}
11 changes: 11 additions & 0 deletions site/blog/app/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico, sitemap.xml, robots.txt (metadata files)
*/
"/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)",
],
};
103 changes: 103 additions & 0 deletions site/blog/public/sitemap-a.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://qhan.wang</loc>
<lastmod>2024-10-12T04:18:52.839Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts</loc>
<lastmod>2024-10-12T04:18:52.839Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/projects</loc>
<lastmod>2024-10-12T04:18:52.839Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/nginx-websocket</loc>
<lastmod>2024-08-14T09:47:15.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/geometry-calculation</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/clipper-lib-guide</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/pixijs-custom-cursor</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/git-common-commands</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/next-unocss</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/next-mdx-contentlayer</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/next-mdx</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/ssr-timezone</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-gradient-circle</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/local-nginx-docker</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/dnd-kit-ant-table</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/test-playwright-auth</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/browser-cache</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-aspect-ratio</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-centered</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/react-component-lifecycle</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/cursor-position</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-checkbox-beautify</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-custom-scrollbar</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/css-nth-child</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
<url>
<loc>https://qhan.wang/posts/regexp</loc>
<lastmod>2024-08-14T06:54:07.000Z</lastmod>
</url>
</urlset>

0 comments on commit 54a521c

Please sign in to comment.