Merge pull request #1178 from flc1125/feature/copyright

[Done] Fix #1171
pull/1180/head
Ruipeng Zhang 2023-01-31 10:20:44 -05:00 committed by GitHub
commit 5f057b6121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -20,7 +20,8 @@
"ecmaFeatures": { "ecmaFeatures": {
"jsx": true "jsx": true
}, },
"sourceType": "module" "sourceType": "module",
"ecmaVersion": "latest"
}, },
"plugins": [ "plugins": [
"react" "react"

View File

@ -4,6 +4,17 @@
"description": "Page footer configurations", "description": "Page footer configurations",
"type": "object", "type": "object",
"properties": { "properties": {
"copyright": {
"description": "Copyright text",
"type": "string",
"examples": [
"© 2019",
"© 2019 - 2020",
"© 2019 - 2020, Company Name",
"© 2019 - 2020, Company Name. All rights reserved.",
"粤ICP备12345678号"
]
},
"links": { "links": {
"$ref": "/misc/poly_links.json", "$ref": "/misc/poly_links.json",
"description": "Links to be shown on the right of the footer section", "description": "Links to be shown on the right of the footer section",

View File

@ -11,6 +11,7 @@ class Footer extends Component {
siteYear, siteYear,
author, author,
links, links,
copyright,
showVisitorCounter, showVisitorCounter,
visitorCounterTitle visitorCounterTitle
} = this.props; } = this.props;
@ -41,6 +42,7 @@ class Footer extends Component {
{showVisitorCounter ? <span id="busuanzi_container_site_uv" {showVisitorCounter ? <span id="busuanzi_container_site_uv"
dangerouslySetInnerHTML={{ __html: visitorCounterTitle }}></span> : null} dangerouslySetInnerHTML={{ __html: visitorCounterTitle }}></span> : null}
</p> </p>
{copyright ? <p class="is-size-7" dangerouslySetInnerHTML={{ __html: copyright }}></p> : null}
</div> </div>
<div class="level-end"> <div class="level-end">
{Object.keys(links).length ? <div class="field has-addons"> {Object.keys(links).length ? <div class="field has-addons">
@ -84,6 +86,7 @@ module.exports = cacheComponent(Footer, 'common.footer', props => {
siteYear: date(new Date(), 'YYYY'), siteYear: date(new Date(), 'YYYY'),
author, author,
links, links,
copyright: footer?.copyright ?? '',
showVisitorCounter: plugins && plugins.busuanzi === true, showVisitorCounter: plugins && plugins.busuanzi === true,
visitorCounterTitle: _p('plugin.visitor_count', '<span id="busuanzi_value_site_uv">0</span>') visitorCounterTitle: _p('plugin.visitor_count', '<span id="busuanzi_value_site_uv">0</span>')
}; };