Skip to content

Instantly share code, notes, and snippets.

@Andy-set-studio
Created November 30, 2020 15:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andy-set-studio/d207bd3c869c95ee9cb24c6449e8c99b to your computer and use it in GitHub Desktop.
Save Andy-set-studio/d207bd3c869c95ee9cb24c6449e8c99b to your computer and use it in GitHub Desktop.
Dynamic date in 11ty
// Put this in _data/helpers.js
module.exports = {
currentYear() {
const today = new Date();
return today.getFullYear();
}
}
{{ helpers.currentYear() }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment