From b856222c53454e49204941677bdc55e29bdf84b6 Mon Sep 17 00:00:00 2001 From: PrinOrange Date: Tue, 26 Dec 2023 11:08:42 +0800 Subject: [PATCH] Add enabling configuration item for RSS portal --- components/utils/Footer.tsx | 8 +++++--- data/config.ts | 5 +++++ pages/index.tsx | 4 +++- types/config.type.ts | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/components/utils/Footer.tsx b/components/utils/Footer.tsx index 4d209f0..ee71834 100644 --- a/components/utils/Footer.tsx +++ b/components/utils/Footer.tsx @@ -29,9 +29,11 @@ export const Footer = () => { {"Friends"} - - - + {Config.RSSFeed?.enabled && ( + + + + )} diff --git a/data/config.ts b/data/config.ts index 2a4dad6..105bccc 100644 --- a/data/config.ts +++ b/data/config.ts @@ -38,6 +38,11 @@ export const Config: TConfig = { categoryId: "DIC_kwDOK44zm84Cb94g", }, + // Enable the RSS Feed? If not, the feed file will not be generated and the feed entrance will be closed. + RSSFeed: { + enabled: true, + }, + // The supported sponsor ways are wechat-pay, alipay and paypal. SponsorLink: { // Your WechatPay QRCode Content. diff --git a/pages/index.tsx b/pages/index.tsx index 69231f9..8005b5d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -76,7 +76,9 @@ export const getStaticProps: GetStaticProps = async () => { } } - await generateRSSFeed(); + if (Config.RSSFeed?.enabled) { + await generateRSSFeed(); + } return { props: { diff --git a/types/config.type.ts b/types/config.type.ts index 8bab43c..483451f 100644 --- a/types/config.type.ts +++ b/types/config.type.ts @@ -20,6 +20,10 @@ export type TConfig = { email: string; }; + RSSFeed?: { + enabled: boolean; + }; + Giscus?: { enabled: boolean; repo: string;