From 8ea84c10e691c4590a994738330233faf77c7d6a Mon Sep 17 00:00:00 2001 From: Ad-closeNN <1709301095@qq.com> Date: Sat, 25 Apr 2026 15:13:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E5=85=A5=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content.config.ts | 1 + src/content/posts/codex-warp.md | 1 + src/pages/posts/[...slug].astro | 23 +++++++++++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/content.config.ts b/src/content.config.ts index 26eeba4..2068e18 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -15,6 +15,7 @@ const postsCollection = defineCollection({ category: z.string().optional().nullable().default(""), showcover: z.boolean().optional().default(true), customcover: z.string().optional().default(""), + outdated: z.boolean().optional().default(false), lang: z.string().optional().default(""), prevTitle: z.string().default(""), prevSlug: z.string().default(""), diff --git a/src/content/posts/codex-warp.md b/src/content/posts/codex-warp.md index 8d4bfd1..7d5a51f 100644 --- a/src/content/posts/codex-warp.md +++ b/src/content/posts/codex-warp.md @@ -7,6 +7,7 @@ showcover: false customcover: /public/pic/codex-warp-banner.png tags: ["Codex", "Warp", "注册机", "AI"] category: '教程' +outdated: true --- # 前言 diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 253e6b5..3a3d332 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -57,6 +57,7 @@ const showcover = entry.data.showcover; // 获取自定义的头图(Markdown 内部) const customcover = entry.data.customcover; +const isOutdated = entry.data.outdated; --- @@ -114,12 +115,26 @@ const customcover = entry.data.customcover; )} -
+
- +
- 本文最后更新于 {lastUpdatedLabel},距今 计算中...。 - 随着时间推移,文中描述可能与当前实际情况有出入,请注意甄别。 + {isOutdated ? ( + <>本文内容部分或全部可能已失效,请谨慎参考。 + ) : ( + <> + 本文最后更新于 {lastUpdatedLabel},距今 计算中...。 + 随着时间推移,文中描述可能与当前实际情况有出入,请注意甄别。 + + )}