Skip to content
Discussion options

You must be logged in to vote

You can’t use {% include %} for anything other than Nunjucks templates and have it be evaluated. The include tag is purely a Nunjucks thing, and Eleventy doesn't have anything to do with it.

My first thought is that what you're looking for is a shortcode: https://www.11ty.dev/docs/shortcodes/

That would let you write some JavaScript functions that returns a string of HTML that you can call from inside your templates.

Another thing that might work is Eleventy’s render plugin: https://www.11ty.dev/docs/plugins/render/

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jneander
Comment options

Answer selected by jneander
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants