The compare/single.html template has a common structure for multiple leaf bundles - for example alternative1.
I want to include lead.md which is different for each page bundle. In compare/single.html I do:
<p class="lead">
{{ with .Resources.Get "lead.md" }}
{{ .Content }}
{{ end }}
</p>
I thought that would simply render the content. But instead, it renders it wrapped with <p> tags, so styles associated with the <p class="lead"> I defined in the template are overridden. I want the power of Markdown wrapping in each of these content files, but I don’t want it wrapped in a <p>.
This seems such a basic function I think I’m approaching this incorrectly. So if you can make alternative suggestions, please do so. Are page bundles the way to do this?
However I want it to potentially be something like:
lorem ipsum
**lorem** ipsum
lorem [ipsum](https://example.com/link)
(i.e. a multiline or single line markdown file)
I’ve tried it with and without empty front matter, but I’m not sure what front matter to use if it needs some.
I guess the issue is that the above will generate with <p> around each paragraph, and a one line piece of content where I don’t want that is a special case. This is why I think I’m approaching this wrong. How does one embed pieces of varying Markdown content for each bundle?
You’re right, I wasn’t thinking this through correctly for all cases. I guess I need to be mindful of the tags wrapped around these imports - and to define more of a schema of the data that each bundle presents (e.g. maybe it’s invalid to provide markdown for this particular block of content if it’s going to be wrapped in a <p>).