Last active
July 8, 2019 11:40
-
-
Save robb0wen/df76f69bca3a082dc22e6603caf75b78 to your computer and use it in GitHub Desktop.
Passing context params to paired shortcodes in 11ty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(config) { | |
config.addPairedShortcode("awfulbutton", function(content, pageUrl) { | |
return `<div class="button lolz" data-href="${pageUrl}">${content}</div>`; | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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