Replies: 1 comment 1 reply
-
A few different ideas:
For the first one, install markdown-it-container and define your container as
For the second option, define a paired shortcode in eleventyConfig.addPairedShortcode("myContainer", function(content) {
return `<section>
${content}
</section>`; Then in your markdown file, do this:
For the third option, simply insert the
This third option assumes that html is enabled in your markdown configuration, which is the 11ty default. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Vague title, I'm sorry. I'm not super familiar with the terminology here or static site generators in general. Basically, I want to write my websites in markdown, but apply formatting to the output html in a consistent way, like this:
becoming:
Anything between a h2 and the next h2 being enclosed in a
<section>
, without writing my markdown files differently. Is this possible? Are other, similar ideas possible as well, like "the first 2 sections are both put inside a parent<div class="example">
, the rest are in a<div class="somethingElse">
?I looked through the documentation & the discussions here, and couldn't find anything (but it's possible I don't know the right search terms for what I want). This seems like something that would exist already, but if it does I can't find it. If it doesn't, what's the best way to do what I'm after?
Beta Was this translation helpful? Give feedback.
All reactions