Apply layout for pages accessed via site.pages.content


I’m trying to render specific md file inside of html using code:

  {% assign subheader = site.pages | where: "title", "subheader" | first %}
  {{ subheader.content }}

It works, but my layout isn’t respected. Does it work as expected? Is there a way to apply this layout?


not real clear on what you mean, but if you are saying that the layout specified on the subheader page is not rendered when you pull that pages content into another page - I think that is correct. The layout of the page you are calling is applied. The content of the sub header page as I understand it is the content of the file before rendering.

If the page subheader is just a part of some pages, have you tried using an include?