diff --git a/src/components/ReplyViaEmail.astro b/src/components/ReplyViaEmail.astro new file mode 100644 index 0000000..9ab399f --- /dev/null +++ b/src/components/ReplyViaEmail.astro @@ -0,0 +1,4 @@ +--- +const { title } = Astro.props; +--- +↩ Reply via Email \ No newline at end of file diff --git a/src/components/Search.astro b/src/components/Search.astro index a2c94f8..8fbb5aa 100644 --- a/src/components/Search.astro +++ b/src/components/Search.astro @@ -1,13 +1,26 @@ --- import {siteConfig} from "../config"; const noscript = siteConfig.noClientJavaScript +const searchEngine = siteConfig.searchEngine || 'google' +const domain = Astro.url.host --- {noscript ? -
+
- + {searchEngine === "duckduckgo" && + + } + {searchEngine === "google" && + + } + {/* broken until M1cr0$0ft get support for it */} + {searchEngine === "bing" && + + }
diff --git a/src/components/ThemeSwitcher@CSSOnly.astro b/src/components/ThemeSwitcher@CSSOnly.astro new file mode 100644 index 0000000..690769f --- /dev/null +++ b/src/components/ThemeSwitcher@CSSOnly.astro @@ -0,0 +1,63 @@ +--- + +--- +
+ + +
+ \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index d4b6ef0..2d6a2e3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,9 +7,10 @@ export const siteConfig = { noClientJavaScript: false, // disable client-side javascript, this will: // 1. disable all built-in client-side javascript from rendering // 2. the full text search will be redirected to a search engine - // 3. the comments will be replaced with email reply + // 3. the comments will be globally disabled // 4. the night mode & back to top will not use Javascript to function // 5. the neko will be force-disabled + authorDefaultEmail: '', // site components navBarItems: [ // additional items in the navbar @@ -18,6 +19,9 @@ export const siteConfig = { { text: "RSS", link: "/rss.xml" }, { text: "GitHub", link: "https://github.com/GrassBlock1/mercury" }, ], + // search + // This only works when noClientJavaScript is enabled + searchEngine: 'bing', // 'google', 'duckduckgo', 'bing'(broken until M1cr0$0ft get support for it), defaults to 'google' // footer // yes you can write html safely here customFooter: 'I have no mouth, and I must SCREAM', diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6f0eb76..6cda7bd 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -2,6 +2,7 @@ import '../styles/global.css'; import Search from '../components/Search.astro'; import ThemeSwitcher from '../components/ThemeSwitcher.astro'; +import ThemeSwitcher_CSSOnly from '../components/ThemeSwitcher@CSSOnly.astro'; import BackToTop from "../components/BackToTop.astro"; import Meta from "../components/helper/head/Meta.astro"; @@ -66,7 +67,7 @@ const { title = pageTitle, description = siteConfig.description, ogImage = "" }