Skip to content

Instantly share code, notes, and snippets.

@robb0wen
Last active July 8, 2019 11: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 robb0wen/df76f69bca3a082dc22e6603caf75b78 to your computer and use it in GitHub Desktop.
Save robb0wen/df76f69bca3a082dc22e6603caf75b78 to your computer and use it in GitHub Desktop.
Passing context params to paired shortcodes in 11ty
module.exports = function(config) {
config.addPairedShortcode("awfulbutton", function(content, pageUrl) {
return `<div class="button lolz" data-href="${pageUrl}">${content}</div>`;
});
};
{% awfulbutton page.url %}I am the worst button{% endawfulbutton %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment