I tried searching around and maybe I’m not using the right words, but I couldn’t exactly find the functinality I wanted.
I am adapting a blog template and want to do the following: the complete and rendered HTML to be included in the index page of that section (aka, the blog articles are sequentially rendered in the index, instead of just a summary).
Is this possible? The paginator picks up the different articles but in the for loop page.content only gets me the content of that block, not the entire rendered page.
What’s “the entire rendered page”? If it’s missing stuff like tags, title… then you would need to edit the templates.
Namely, whatever template is being used to render the entire content (each article by itself) would need to be introduced in whatever template is using the paginator (presumably section.html).
I have multiple pages in this section that I want to include in full in the main page. I am not sure how I can include that template in the main page and still keep the article rendering like all the separate frontmatter for those articles.
So instead of just including the content as it does now, I want it to render the template of that article and include that html in the section where it now says {{ page.content }} in the for-each.
I don’t think there’s support for what you want, in exactly the way you describe, sorry. As mentioned elsewhere macros are probably the most idiomatic way of doing this and what I’d recommend.
However, if you still want to do it, I think that there might be a way to emulate the same behavior that you were describing, although I haven’t tried it myself and I think that it might not work with template inheritance.
Let’s say you have a page called page1.md as follows:
+++
template = "example.html"
+++
this is an example
So that page above has a template called example.html. If you wanted to “render” the html of page1.md but in the code you showed above, you may be able to do so by using {% include "example.html" %}. What’s going to happen is whatever variables you have in the outer template will be made available to example.html when include is used. So, if you have a variable called page for example, and that’s what example.html normally uses, then you can probably emulate what you wanted.
Where I think this may be a problem for you is if have any kind of inheritance in your page’s template. I don’t think using includes and using extends really mix very well.
Again, I haven’t tested this myself, but I think it’s possible. Hope that helps!
Isn’t it enough to replace the {{ page.content }} line with the actual template that renders the page?
For example, I render a list of posts with this macro. As you can see, it shows some metadata (tags, date) and the summary.
If I wanted to “embed” the actual post content on the listing, I would modify this “list all posts” template so that, for each post, it renders whatever is visible on the actual post page (date, headers… whatever).
The same way it’s being rendered in the individual article’s template: by accessing the proper variables (e.g. accessing post.date from my macro link).