I’m new to Jekyll and trying to figure out how to modify the site I’ve been given, specifically the layout files.
The layout file is using Dynamic tabs in the form of nav-pills. The site originally had two tabs, the first with some in-file html code and the second contains the {{ content }} variable. I’ve added a 3rd tab and my question is how do I add another {{ content }} variable that will reflect a page2.md file that I have while maintaining the original {{ content }} link to page1.md?
{% capture first-section %}
Here is my first section content!
{% endcapture %}
{% capture second-section %}
Here is the second section!
{% endcapture %}
{% include template.html %}
Thanks! How would I call those sections in my template file… Just use {{ first-section}} or would I need to use an include call to pull the .html file?
When I’m referencing the sections that I created in my layout file, I’m using {{ section 1}} and {{ section 2 }} but that doesn’t seem to be working. Is this another way to call these sections in the layout file, similar to how the {{ content }} variable would work?
Makes sense. Any idea what the right syntax for that would be? I’m trying the following, but it’s not compiling. I’m sure I just need to set something to section-one instead of just passing it in, but I’m not sure what.
You shouldn’t need to pass it at all, just including it. I just remembered I did a gist explaining that for another post so here it is, if it can help you : _includes index.html · GitHub
the only way to include page2.md is if it is an include. But then it would not be its own page and other than being able to include it on another page I don’t see an advantage.
Why can’t you just use html like the first one does?
another option is a data file, I use it for things that repeat a pattern like faqs.