Skip to content

Commit 619b05b

Browse files
use date +%Y in config.env for dynamic footer year
1 parent 7b02301 commit 619b05b

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

client/src/views/footer.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,8 @@ export default ({ t, page }) =>
4646
{ process.env.TERMS && <span><a href={ process.env.TERMS } target="_blank">Terms &amp; </a></span> }
4747
{ process.env.PRIVACY && <span><a href={ process.env.PRIVACY } target="_blank">Privacy</a></span> }
4848
</div>
49-
{
50-
(() => {
51-
let raw = process.env.SITE_FOOTER || t`Powered by esplora`
52-
const year = String(new Date().getFullYear())
53-
// if a year already exists in the footer text, replace it with the current year
54-
if (/\b\d{4}\b/.test(raw)) {
55-
return raw.replace(/\b\d{4}\b/, year)
56-
}
57-
// if the footer text starts with ©, insert the current year right after it
58-
if (raw.match(/^©/i)) {
59-
return raw.replace(/^©\s*/i, ${year} `)
60-
}
61-
// otherwise, just stick the current year at the front
62-
return `${year} ${raw}`
63-
})()
64-
}</div>
49+
<div>{ process.env.SITE_FOOTER || t`Powered by esplora` }</div>
6550
</div>
6651
</div>
67-
</footer>
52+
</div>
53+
</footer>

flavors/blockstream/config.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export SITE_DESC='Blockstream Explorer is an open source block explorer providing detailed blockchain data across Bitcoin, Testnet, and Liquid. Supports Tor and tracking-free.'
2-
export SITE_FOOTER='© Blockstream Corporation Inc. All rights reserved.'
2+
export SITE_FOOTER="© $(date +%Y) Blockstream Corporation Inc. All rights reserved."
33
export HEAD_HTML=\
44
'<meta property="og:image" content="https://blockstream.info/img/social-sharing.png">'\
55
'<meta name="twitter:image" content="https://blockstream.info/img/social-sharing.png">'\

0 commit comments

Comments
 (0)