Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A page can have only one <code>layout</code>, but layouts can be nested.</p> <p>I have three <code>_layouts</code>:</p> <ul> <li>master.html</li> <li>default.html</li> <li>post.html</li> </ul> <p>The <code>master</code> layout has all of the basic structure that any page I want will need. It looks something like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;{{ page.title }}&lt;/title&gt; &lt;/head&gt; &lt;body&gt; {{ content }} &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I use the <code>default</code> layout for most pages that are not blog posts. I do make extensive use of a few <code>page</code> variables in pages' YAML front matter. The layout looks something like this:</p> <pre><code>--- layout: master --- &lt;h1&gt; {{ page.title }} {% if page.subtitle %}&lt;small&gt;{{ page.subtitle }}&lt;/small&gt;{% endif %} &lt;/h1&gt; {% if page.description %}&lt;p&gt;{{ page.description }}&lt;/p&gt;{% endif %} {{ content }} </code></pre> <p>I use the <code>post</code> layout for <code>_posts</code> pages. It looks like this:</p> <pre><code>--- layout: default --- &lt;p&gt;Posted {{ page.date }}&lt;/p&gt; &lt;ul&gt;{% for tag in page.tags %}...{% endfor %}&lt;/ul&gt; {{ content }} </code></pre> <p>Every blog post that I make, I use the <code>post</code> layout, and they inherit from all three layouts.</p> <p>If you want to have snippets of reusable markup, then I would recommend using <a href="https://github.com/mojombo/jekyll/wiki/Liquid-Extensions"><code>_includes</code></a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload