From 3b96b42d4bed2ba0f41e3c1dcff7387653b641d9 Mon Sep 17 00:00:00 2001 From: grassblock Date: Sun, 18 May 2025 16:48:51 +0800 Subject: [PATCH 1/2] chore(static web apps): fix 404 page --- staticwebapp.config.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 staticwebapp.config.json diff --git a/staticwebapp.config.json b/staticwebapp.config.json new file mode 100644 index 0000000..c56f2f2 --- /dev/null +++ b/staticwebapp.config.json @@ -0,0 +1,19 @@ +{ + "trailingSlash": "auto", + "routes": [ + { + "route": "/*", + "headers": { + "cache-control": "must-revalidate, max-age=15770000" + } + } + ], + "responseOverrides": { + "404": { + "rewrite": "/404.html" + } + }, + "globalHeaders": { + "content-security-policy": "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'" + } +} \ No newline at end of file From 7851abb2627d7f217d3ab65533118edb7155b9b9 Mon Sep 17 00:00:00 2001 From: grassblock Date: Sun, 18 May 2025 17:01:00 +0800 Subject: [PATCH 2/2] refactor: use imported svg to display logos --- {public => src/assets}/mercury.svg | 0 src/layouts/Layout.astro | 6 ++++-- src/styles/global.css | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) rename {public => src/assets}/mercury.svg (100%) diff --git a/public/mercury.svg b/src/assets/mercury.svg similarity index 100% rename from public/mercury.svg rename to src/assets/mercury.svg diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index a1d7633..50b9cdf 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -3,9 +3,11 @@ import '../styles/global.css'; import Search from '../components/Search.astro'; import ThemeSwitcher from '../components/ThemeSwitcher.astro'; import BackToTop from "../components/BackToTop.astro"; -import { siteConfig } from "../config"; import Meta from "../components/helper/head/Meta.astro"; +import { siteConfig } from "../config"; +import Logo from '../assets/mercury.svg' + interface Props { title: string; description: string; @@ -65,7 +67,7 @@ const { title = pageTitle, description = siteConfig.description, ogImage = "" }
-

Powered by mercury logo mercury

+

Powered by mercury

{ siteConfig.neko.enabled && diff --git a/src/styles/global.css b/src/styles/global.css index f211a81..b20c67a 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -134,7 +134,7 @@ main { opacity: 0.7; } -.footer img { +.footer svg { vertical-align: middle; }