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 e6609a9
Show file tree
Hide file tree
Showing 2 changed files with 14 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).*)",
],
};

0 comments on commit e6609a9

Please sign in to comment.