From 62d788af6c4c7b54d98374e71c3f6f899c817948 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Fri, 28 Jun 2024 03:57:09 +0800 Subject: [PATCH] feat: add switch for astro badge. --- options.ts | 14 +++++--- src/components/footer/Footer.astro | 52 +++++++++++++++++------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/options.ts b/options.ts index 0531e67..cf2d102 100644 --- a/options.ts +++ b/options.ts @@ -30,8 +30,11 @@ const Options = z }), ), settings: z.object({ - initialYear: z.number().max(2024), - icpNo: z.string().optional(), + footer: z.object({ + initialYear: z.number().max(2024), + icpNo: z.string().optional(), + astroBadge: z.boolean().default(true), + }), locale: z.string().optional().default('zh-CN'), timeZone: z.string().optional().default('Asia/Shanghai'), timeFormat: z.string().optional().default('yyyy-MM-dd HH:mm:ss'), @@ -149,8 +152,11 @@ const options: z.input = { }, ], settings: { - initialYear: 2011, - icpNo: '皖ICP备2021002315号-2', + footer: { + initialYear: 2011, + icpNo: '皖ICP备2021002315号-2', + astroBadge: true, + }, locale: 'zh-CN', timeZone: 'Asia/Shanghai', timeFormat: 'yyyy-MM-dd', diff --git a/src/components/footer/Footer.astro b/src/components/footer/Footer.astro index 2aa7e2f..6a3b2a2 100644 --- a/src/components/footer/Footer.astro +++ b/src/components/footer/Footer.astro @@ -5,38 +5,44 @@ import { DateTime } from 'luxon';