Logo

How to do UNIFIED NAVIGATION

_site/bulletin/001-job.html turns into _site/bulletin/001/ .. index.html .. work.html .. extra.html .. contact.html

page.url variable holds the currenturl can compare to data in an item.url to add a class on loop.

index.html navigation section on left content section on right

layout.html is called from page #nav includes page variable that (1) is NAVIGATION #content gets <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight">for (var i=0;i<100;i++) { console.log(i); switch(a) { case '1': case '2': } } </pre></div></div> for normal content

data could come from [=] page.var - but page var changes on each page [ ] _data directory [ ] _include `

REFERENCES BELOW

VARIABLES

site page layout content

includes have include.* inside of them, used to access passed variables can also access site and page content, but not

INCLUDE

FROM INCLUDES FOLDER (_includes) {% include footer.html %}

FROM RELATIVE FOLDER {% include_relative somedir/footer.html %}

FROM PAGE VARIABLE

title: My page my_variable: footer_company_a.html — {% if page.my_variable %} {% include {{ page.my_variable }} %} {% endif %}

INSERT PARAMETER html in include template

call from page {% include note.html content=”This is my sample note.” %

TEMPLATE

FROM LAYOUT (_layout) use layout: front matter and specify name of file

The layout will receive <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight">for (var i=0;i<100;i++) { console.log(i); switch(a) { case '1': case '2': } } </pre></div></div> global variable from the calling page or post, which is everything after front matter.

Layouts can access page object front matter, site object, and

CAPTURING OUTPUT

this is how you do stringconcat

capture {% capture my_variable %}I am being captured.{% endcapture %}

emit variable {{ my_variable }}

{% assign my_variable = false %} also works

MISC

filters {{ “/my/fancy/url” | append: “.html” }} comments {% comment %} and {% endcomment %}

DATA

FROM DATA (_data) in _data/folder/blah (YAML, JSON, CSV, and TSV) e.g. _data/members.yml access with (if there are subdirectories, will get a ‘hash’ of all filenames)

{% for member in site.data.members %} {{ member.name }} {% endfor %}

access element inside the data {{ site.data.people[‘dave’]}}

NAVIGATION

DATA FILE

docs_list_title: ACME Documentation docs:

LIQUID

adding hilighting