From c010909e2ae2844708ba4e8f69568555b6bd7397 Mon Sep 17 00:00:00 2001 From: QihanNX Date: Sat, 13 Jun 2026 16:29:12 +0800 Subject: [PATCH] Update Footer.astro --- src/components/Footer.astro | 87 +++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 9f4f3d6..77ce307 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,30 +1,69 @@ --- -import type { HTMLAttributes } from "astro/types"; -import Socials from "./Socials.astro"; -import { useTranslations } from "@/i18n"; - -type Props = { - noMarginTop?: boolean; -} & HTMLAttributes<"footer">; - -const { noMarginTop = false, class: className, ...attrs } = Astro.props; - -const t = useTranslations(Astro.currentLocale); +// --- 1. 组件脚本 (Frontmatter) --- +// 在这里编写JavaScript逻辑,这部分代码只在构建时运行,不会发送到浏览器 +import { YOUR_ICP_NUMBER } from '../config'; // 假设你将备案号存在了配置文件中 const currentYear = new Date().getFullYear(); +// 你也可以直接从组件属性(props)获取数据,这里为了简洁,先写为固定值 +// 更多关于在组件脚本中编写JS的内容:https://www.astrojs.cn/zh-cn/basics/astro-components/[reference:2] --- -