Skip to content

Instantly share code, notes, and snippets.

@Andy-set-studio
Created November 30, 2020 15:35
Show Gist options
  • 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