You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playing around w/ the new Render plugin today in 1.0.0-beta.8 (npm i @11ty/eleventy@beta):
---
# index.njk
myData:
title: book club
text: "What is **bold** or _italics_?"
---
<h1>{{myData.title}}</h1>
<pre>{{myData.text | safe}}</pre>
<!-- This tripped me up a bit since I wanted my markdown snippet to also process Nunjucks variables, so I had to specify "md,njk". Also note that you need to specify the variables/context in your rendered block as an object.-->{%renderTemplate"md,njk", myData%}
# {{title}}{{text}}
1. I am a list
1. I am a list
> Oh snap!
```js
const codeFence = true;
```
{%endrenderTemplate%}
<h1>book club</h1><pre>What is **bold** or _italics_?</pre><h1>book club</h1><p>What is <strong>bold</strong> or <em>italics</em>?</p><ol><li>I am a list</li><li>I am a list</li></ol><blockquote><p>Oh snap!</p></blockquote><pre><codeclass="language-js">const codeFence = true;
</code></pre>
This felt a bit strange, but I didn't want to figure out how to construct objects to pass to the {% renderTemplate %} tag, so I abused the eleventyComputed a little to return the raw data:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Playing around w/ the new Render plugin today in 1.0.0-beta.8 (npm i @11ty/eleventy@beta):
OUTPUT
This felt a bit strange, but I didn't want to figure out how to construct objects to pass to the
{% renderTemplate %}
tag, so I abused theeleventyComputed
a little to return the rawdata
:OUTPUT
Beta Was this translation helpful? Give feedback.
All reactions