Created
November 30, 2020 15:35
-
-
Save Andy-set-studio/d207bd3c869c95ee9cb24c6449e8c99b to your computer and use it in GitHub Desktop.
Dynamic date in 11ty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this in _data/helpers.js | |
module.exports = { | |
currentYear() { | |
const today = new Date(); | |
return today.getFullYear(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ helpers.currentYear() }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment