Skip to content

Instantly share code, notes, and snippets.

@KyleMit
Created May 8, 2020 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KyleMit/e8e751550f20997b8269b78b0722edd2 to your computer and use it in GitHub Desktop.
Save KyleMit/e8e751550f20997b8269b78b0722edd2 to your computer and use it in GitHub Desktop.
11ty / Nunjucks Shortcode
module.exports = function(eleventyConfig) {
eleventyConfig.addShortcode("year", () => new Date().getFullYear());
}
© {% year %}
© {% year %}
{
"name": "shortcode",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@11ty/eleventy": "^0.10.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment