-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template Render Error with Markdown file using Nunjucks engine #791
Comments
Use Nunjucks Have a look there for more insight (NB: this site is still beta!). |
Thanks @octoxalis! Indeed if I wrap the code block in |
A few ideas here:
|
Thanks @zachleat! Option #2 was where I started. I omitted any Markdown template language (setting Wrapping code blocks in nunjucks Do you think there's a way to say, "Howdy, template engine, when you render Markdown files do us a solid and don't process code contained inside triple backslash code blocks, that's not code to be rendered, that's code to be displayed ya silly." hahah |
@zachleat, just a little update. I dug around the 11ty docs site code and saw that wrapping code blocks with Feel free to close if you like! |
|
Template Render Error with Markdown file as Nunjucks engine if a fenced code block contains Nunjucks code that conflicts with code already in layout
Describe the bug
When writing a fenced code block in a Markdown file that contains Nunjucks code - specifically wanting to display a simple template example like:
11ty throws an error - in this case it is processing the code block as Nunjucks and looks for that layout.njk.
Originally I was just gonna define markdownTemplateEngine as false but I'm using shortcodes (Universal) as well.
I could just define the markdownTemplateEngine as
11ty.js
(or some other random language) and the error vanishes since it's not trying to convert that raw Nunjucks code. I was curious if there was another solution - maybe one where the renderer knows not to worry about the stuff in the code block? - That way I can continue using Nunjucks as the template engine for markdown rather than the above workaround.Hope that makes sense!
Expected behavior
11ty ignores markdown template engine code inside markdown files if it is inside a code block
Environment:
The text was updated successfully, but these errors were encountered: