Skip to content

Commit 86179af

Browse files
change year on footer to be dynamic
1 parent b380f08 commit 86179af

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

client/src/views/footer.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,19 @@ 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-
<div>{ process.env.SITE_FOOTER || t`Powered by esplora` }</div>
49+
{
50+
(() => {
51+
let raw = process.env.SITE_FOOTER || t`Powered by esplora`
52+
const year = String(new Date().getFullYear())
53+
if (/\b\d{4}\b/.test(raw)) {
54+
return raw.replace(/\b\d{4}\b/, year)
55+
}
56+
if (raw.match(/^©/i)) {
57+
return raw.replace(/^©\s*/i, ${year} `)
58+
}
59+
return `${year} ${raw}`
60+
})()
61+
}</div>
5062
</div>
5163
</div>
52-
</div>
5364
</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='© 2025 Blockstream Corporation Inc. All rights reserved.'
2+
export SITE_FOOTER='© 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)