From b41318f767d88071f97feaaba6aa31cccbf13371 Mon Sep 17 00:00:00 2001 From: qhan Date: Sat, 12 Oct 2024 12:18:15 +0800 Subject: [PATCH] feat(site/blog): add middleware --- site/blog/app/(web)/components/Theme.tsx | 6 +- site/blog/app/middleware.ts | 11 ++ site/blog/public/sitemap-a.xml | 103 +++++++++++ site/blog/public/sitemap-b.xml | 222 +++++++++++++++++++++++ 4 files changed, 339 insertions(+), 3 deletions(-) create mode 100644 site/blog/app/middleware.ts create mode 100644 site/blog/public/sitemap-a.xml create mode 100644 site/blog/public/sitemap-b.xml diff --git a/site/blog/app/(web)/components/Theme.tsx b/site/blog/app/(web)/components/Theme.tsx index ab42762..e616169 100644 --- a/site/blog/app/(web)/components/Theme.tsx +++ b/site/blog/app/(web)/components/Theme.tsx @@ -7,11 +7,11 @@ export default function Theme() { const isDark = theme === "dark"; return ( - 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" > - + ); } diff --git a/site/blog/app/middleware.ts b/site/blog/app/middleware.ts new file mode 100644 index 0000000..d18802d --- /dev/null +++ b/site/blog/app/middleware.ts @@ -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).*)", + ], +}; diff --git a/site/blog/public/sitemap-a.xml b/site/blog/public/sitemap-a.xml new file mode 100644 index 0000000..fad32de --- /dev/null +++ b/site/blog/public/sitemap-a.xml @@ -0,0 +1,103 @@ + + + +https://qhan.wang +2024-10-12T04:18:52.839Z + + +https://qhan.wang/posts +2024-10-12T04:18:52.839Z + + +https://qhan.wang/projects +2024-10-12T04:18:52.839Z + + +https://qhan.wang/posts/nginx-websocket +2024-08-14T09:47:15.000Z + + +https://qhan.wang/posts/geometry-calculation +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/clipper-lib-guide +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/pixijs-custom-cursor +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/git-common-commands +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/next-unocss +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/next-mdx-contentlayer +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/next-mdx +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/ssr-timezone +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-gradient-circle +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/local-nginx-docker +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/dnd-kit-ant-table +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/test-playwright-auth +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/browser-cache +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-aspect-ratio +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-centered +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/react-component-lifecycle +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/cursor-position +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-checkbox-beautify +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-custom-scrollbar +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/css-nth-child +2024-08-14T06:54:07.000Z + + +https://qhan.wang/posts/regexp +2024-08-14T06:54:07.000Z + + diff --git a/site/blog/public/sitemap-b.xml b/site/blog/public/sitemap-b.xml new file mode 100644 index 0000000..3a9a228 --- /dev/null +++ b/site/blog/public/sitemap-b.xml @@ -0,0 +1,222 @@ + + + + + + + https://qhan.wang/ + 2024-10-12T04:41:30+00:00 + 1.00 + + + https://qhan.wang/posts + 2024-10-12T04:41:30+00:00 + 0.80 + + + https://qhan.wang/code-snippets + 2024-10-12T04:41:30+00:00 + 0.80 + + + https://qhan.wang/tools + 2024-10-12T04:41:30+00:00 + 0.80 + + + https://qhan.wang/posts/nginx-websocket + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/geometry-calculation + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/clipper-lib-guide + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/pixijs-custom-cursor + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/git-common-commands + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/next-unocss + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/next-mdx-contentlayer + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/next-mdx + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/ssr-timezone + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-gradient-circle + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/local-nginx-docker + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/dnd-kit-ant-table + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/test-playwright-auth + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/browser-cache + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-aspect-ratio + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-centered + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/react-component-lifecycle + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/cursor-position + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-checkbox-beautify + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-custom-scrollbar + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/css-nth-child + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/posts/regexp + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/antd-tree + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/debounce-and-throttle + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/array-to-tree + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/recursive-lookup + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/array-set-calculation + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/auto-time-update + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/hash-time-33 + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/javascript-download + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/search-param + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/modal-hidden-self + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/react-context-api + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/modal + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/delete-key + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/deep-clone + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/deduplication + 2024-10-12T04:41:30+00:00 + 0.64 + + + https://qhan.wang/code-snippets/js-sort + 2024-10-12T04:41:30+00:00 + 0.64 + + + + \ No newline at end of file