Loop over html of .Content


Would it be possible to do something like this:

{{ with .GetPage "example.md" }}
    {{ range .Content }}
    {{ end}
{{ end }}

And then check for an element?

I want to generate A new section based on every H1 in an element. Currently its just one list of html so I was thinking if I can check if currently line starts with <h1> insert a </section><section>. Or is there a better way to do so?

Not possible.

If you have HTML in your file then just put the <section> tags around the sections. If not Markdown might stop interpreting what’s inside these tags (not tested, but it does so when you add div tags around something).