From 7b02301ff9e3d1fbec435e61cf07bc54be596e8a Mon Sep 17 00:00:00 2001 From: susan githaiga Date: Tue, 3 Mar 2026 05:29:25 +0300 Subject: [PATCH] change year on footer to be dynamic --- client/src/views/footer.js | 18 ++++++++++++++++-- flavors/blockstream/config.env | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/client/src/views/footer.js b/client/src/views/footer.js index 06e43d04..f0242894 100644 --- a/client/src/views/footer.js +++ b/client/src/views/footer.js @@ -46,8 +46,22 @@ export default ({ t, page }) => { process.env.TERMS && Terms & } { process.env.PRIVACY && Privacy } -
{ process.env.SITE_FOOTER || t`Powered by esplora` }
+ { + (() => { + let raw = process.env.SITE_FOOTER || t`Powered by esplora` + const year = String(new Date().getFullYear()) + // if a year already exists in the footer text, replace it with the current year + if (/\b\d{4}\b/.test(raw)) { + return raw.replace(/\b\d{4}\b/, year) + } + // if the footer text starts with ©, insert the current year right after it + if (raw.match(/^©/i)) { + return raw.replace(/^©\s*/i, `© ${year} `) + } + // otherwise, just stick the current year at the front + return `${year} ${raw}` + })() + } - diff --git a/flavors/blockstream/config.env b/flavors/blockstream/config.env index 315def95..2ca67305 100755 --- a/flavors/blockstream/config.env +++ b/flavors/blockstream/config.env @@ -1,5 +1,5 @@ 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.' -export SITE_FOOTER='© 2025 Blockstream Corporation Inc. All rights reserved.' +export SITE_FOOTER='© Blockstream Corporation Inc. All rights reserved.' export HEAD_HTML=\ ''\ ''\