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] --- -