I'm having some difficulty getting Jekyll to use a particular theme and I think there's something fundamental I'm missing about how {{ content }}
works with posts.
So, in a generic Jekyll site, index.html
has a layout specified in its front matter. When the site is generated, the layout includes index.html
as {{ content }}
. It's kind of inverted, where the page specifies the layout and then the layout calls the page, but simple enough.
Posts, on the other hand, are all generated via a file, post.html
, which resides in the _layouts
folder even though it isn't really a layout. Like index.html
it's essentially just a for loop. This is where I'm running into trouble.
Is post.html
a required file? Could I rename it story.html
?
Why does post.html
require a layout in the front matter? The actual post, that is, the markdown that contains the text for said post, also requires a layout in its front mater. Is there a circumstance where post.html
would have a different layout than the layout specified in the markdown file?
Edit: one other question. Why is {{ content }}
called in multiple places? index.html
and the layout file both have {{ content }}. Why doesn't the layout simply {% include %} index.html
and let index.html
call {{ content }}