Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.