diff --git a/src/components/LightDarkSwitch.svelte b/src/components/LightDarkSwitch.svelte index 50f0906..70595d7 100644 --- a/src/components/LightDarkSwitch.svelte +++ b/src/components/LightDarkSwitch.svelte @@ -11,8 +11,8 @@ import { import { onMount } from "svelte"; import type { LIGHT_DARK_MODE } from "@/types/config.ts"; -const seq: LIGHT_DARK_MODE[] = [LIGHT_MODE, DARK_MODE, AUTO_MODE]; -let mode: LIGHT_DARK_MODE = $state(AUTO_MODE); +const seq: LIGHT_DARK_MODE[] = [LIGHT_MODE, DARK_MODE]; +let mode: LIGHT_DARK_MODE = LIGHT_MODE; onMount(() => { mode = getStoredTheme(); @@ -66,9 +66,6 @@ function hidePanel() {
-
- -
- + +
-
- {remarkPluginFrontmatter.words} {" " + i18n(remarkPluginFrontmatter.words === 1 ? I18nKey.wordCount : I18nKey.wordsCount)} -
+
{remarkPluginFrontmatter.words} {" " + i18n(I18nKey.wordsCount)}
+
|
+
{remarkPluginFrontmatter.minutes} {" " + i18n(I18nKey.minutesCount)}
|
- {remarkPluginFrontmatter.minutes} {" " + i18n(remarkPluginFrontmatter.minutes === 1 ? I18nKey.minuteCount : I18nKey.minutesCount)} + 加载中...
@@ -106,5 +108,72 @@ const { remarkPluginFrontmatter } = await entry.render();
+ + + + + + + diff --git a/src/components/PostMeta.astro b/src/components/PostMeta.astro index 488e85e..1f87be6 100644 --- a/src/components/PostMeta.astro +++ b/src/components/PostMeta.astro @@ -1,9 +1,11 @@ --- +import path from "node:path"; import { Icon } from "astro-icon/components"; import I18nKey from "../i18n/i18nKey"; import { i18n } from "../i18n/translation"; import { formatDateToYYYYMMDD } from "../utils/date-utils"; -import { getCategoryUrl, getTagUrl } from "../utils/url-utils"; +import { getCategoryUrl, getTagUrl, getDir, url } from "../utils/url-utils"; +import { umamiConfig } from "../config"; interface Props { class: string; @@ -13,6 +15,7 @@ interface Props { category: string | null; hideTagsForMobile?: boolean; hideUpdateDate?: boolean; + slug?: string; } const { published, @@ -21,6 +24,7 @@ const { category, hideTagsForMobile = false, hideUpdateDate = false, + slug, } = Astro.props; const className = Astro.props.class; --- @@ -35,7 +39,7 @@ const className = Astro.props.class; {formatDateToYYYYMMDD(published)} - +
@@ -79,4 +84,72 @@ const className = Astro.props.class; {!(tags && tags.length > 0) &&
{i18n(I18nKey.noTags)}
}
- \ No newline at end of file + + {slug && ( +
+
+ +
+ 加载中... +
+ )} + + + + +{slug && ( + +)} \ No newline at end of file diff --git a/src/components/widget/Profile.astro b/src/components/widget/Profile.astro index 4c0897d..2a66393 100644 --- a/src/components/widget/Profile.astro +++ b/src/components/widget/Profile.astro @@ -1,6 +1,6 @@ --- import { Icon } from "astro-icon/components"; -import { profileConfig } from "../../config"; +import { profileConfig, umamiConfig } from "../../config"; import { url } from "../../utils/url-utils"; import ImageWrapper from "../misc/ImageWrapper.astro"; @@ -34,6 +34,65 @@ const config = profileConfig; {config.links[0].name} } + + +
+
+ + 加载中... +
+
+ + \ No newline at end of file diff --git a/src/config.ts b/src/config.ts index 1ff984c..625753c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,10 +1,10 @@ import type { - ImageFallbackConfig, ExpressiveCodeConfig, LicenseConfig, NavBarConfig, ProfileConfig, SiteConfig, + UmamiConfig, } from "./types/config"; import { LinkPreset } from "./types/config"; @@ -28,7 +28,8 @@ export const siteConfig: SiteConfig = { }, background: { enable: true, // Enable background image - src: "https://eo-pic.2x.nz/h", // Background image URL (supports HTTPS) + //src: "https://eo-pic.2x.nz/h", // Background image URL (supports HTTPS) + src: "https://api.bimg.cc/random", // Bing daily theme position: "center", // Background position: 'top', 'center', 'bottom' size: "cover", // Background size: 'cover', 'contain', 'auto' repeat: "no-repeat", // Background repeat: 'no-repeat', 'repeat', 'repeat-x', 'repeat-y' @@ -58,8 +59,8 @@ export const navBarConfig: NavBarConfig = { LinkPreset.Archive, LinkPreset.About, { - name: "GiwtHub", - url: "https://github.com/saicaca/fuwari", // Internal links should not include the base path, as it is automatically added + name: "统计信息", + url: "https://github.com/统计信息", // Internal links should not include the base path, as it is automatically added external: true, // Show an external link icon and will open in a new tab }, ], @@ -104,8 +105,9 @@ export const expressiveCodeConfig: ExpressiveCodeConfig = { theme: "github-dark", }; -export const imageFallbackConfig: ImageFallbackConfig = { +export const umamiConfig: UmamiConfig = { enable: true, - originalDomain: "eo-r2.2x.nz", - fallbackDomain: "pub-d433ca7edaa74994b3d7c40a7fd7d9ac.r2.dev", + baseUrl: "https://umami.adclosenn.top", + shareId: "XMDJoIb1D21UxHdH", + timezone: "Asia/Shanghai", }; \ No newline at end of file diff --git a/src/types/config.ts b/src/types/config.ts index c658b14..c8c474b 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -115,4 +115,11 @@ export type ImageFallbackConfig = { enable: boolean; originalDomain: string; fallbackDomain: string; +}; + +export type UmamiConfig = { + enable: boolean; + baseUrl: string; + shareId: string; + timezone: string; }; \ No newline at end of file