From f0c01a615b2f7995d4c50e68690e6b090e00c6eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Flc=E3=82=9B?=
Date: Mon, 16 Jan 2023 17:21:05 +0800
Subject: [PATCH 1/2] feat(footer): added copyright
---
include/schema/common/footer.json | 10 ++++++++++
layout/common/footer.jsx | 3 +++
2 files changed, 13 insertions(+)
diff --git a/include/schema/common/footer.json b/include/schema/common/footer.json
index e322bc7..3bd55c2 100644
--- a/include/schema/common/footer.json
+++ b/include/schema/common/footer.json
@@ -4,6 +4,16 @@
"description": "Page footer configurations",
"type": "object",
"properties": {
+ "copyright": {
+ "$ref": "/misc/copyright.json",
+ "description": "Copyright text",
+ "type": "string",
+ "examples": [
+ "© 2019",
+ "© 2019 - 2020",
+ "粤ICP备1234567号"
+ ]
+ },
"links": {
"$ref": "/misc/poly_links.json",
"description": "Links to be shown on the right of the footer section",
diff --git a/layout/common/footer.jsx b/layout/common/footer.jsx
index 9027107..baa52f5 100644
--- a/layout/common/footer.jsx
+++ b/layout/common/footer.jsx
@@ -11,6 +11,7 @@ class Footer extends Component {
siteYear,
author,
links,
+ copyright,
showVisitorCounter,
visitorCounterTitle
} = this.props;
@@ -41,6 +42,7 @@ class Footer extends Component {
{showVisitorCounter ? : null}
+ {copyright ? : null}
{Object.keys(links).length ?
@@ -84,6 +86,7 @@ module.exports = cacheComponent(Footer, 'common.footer', props => {
siteYear: date(new Date(), 'YYYY'),
author,
links,
+ copyright: footer.copyright,
showVisitorCounter: plugins && plugins.busuanzi === true,
visitorCounterTitle: _p('plugin.visitor_count', '0')
};
From df9961613485cae6846a430a5dad8ec98c087380 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Flc=E3=82=9B?=
Date: Tue, 17 Jan 2023 09:18:02 +0800
Subject: [PATCH 2/2] =?UTF-8?q?fix(footer):=20fixed=20footer=20may=20be=20?=
=?UTF-8?q?null=20or=20undefined=E2=80=A6=E2=80=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layout/common/footer.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layout/common/footer.jsx b/layout/common/footer.jsx
index baa52f5..fcdecd9 100644
--- a/layout/common/footer.jsx
+++ b/layout/common/footer.jsx
@@ -86,7 +86,7 @@ module.exports = cacheComponent(Footer, 'common.footer', props => {
siteYear: date(new Date(), 'YYYY'),
author,
links,
- copyright: footer.copyright,
+ copyright: footer?.copyright ?? '',
showVisitorCounter: plugins && plugins.busuanzi === true,
visitorCounterTitle: _p('plugin.visitor_count', '0')
};