+++
title ="post1"
+++
#Headline 1
Text 1
+++
#Headline 2
Text 2
in layout -->
…
< div >
{{.Content[1]}} --> renders Headline 1 and Text 1
< /div >
< div >
{{.Content[2]}} --> renders Headline 2 and Text 2
< \div >
…
Well i could wrap parts before/after < hr > with javascript… but that wouldn’t be very nice…
Unfortunately i couldn’t find anything about this “basic?” use-case or i was searching for the wrong things.
I think I’d need to see what you’re trying to do, but if the content in one section is only headings, you could get clever with the front matter as well. Or you could do something with .Next or . Prev maybe…?
You could use the split template function. Just insert a custom delimiter in the content files at each point where the content should continue in the next column.
Your code would look as follows. I have not tested it but you should get at least a foundation. <split> is our custom delimiter.
{{ $cols := split .Content "<split>" }}
{{ range $cols }}
<div class="content-column">
{{ . }}
</div>
{{ end }}
I found this post when searching for a a way to place an image next to text (in a two colomn way), and it helpt me achieve this by creating a partial like this: