Sha256: 9514ee40892518eb77afb8ca7ef57b3e08da6ee91bd20b143b5c98dbff83ca00

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

{% capture api %}
Render `<main>` content and eventually the sidebar.  
Split content by `<!--row-->` and `<!--column-->` and loop to render.

- **Called by** `_layouts/default.html`
- **Call** `_includes/page/sidebar.html`
{% endcapture %}
{%- include api/save.html -%}
<main class="container{{ fluid }}">
  {%- comment -%} Check sidebar left {%- endcomment -%}
  {% if sidebar.side == 'left' %}
  <div class="row">
    {% include page/sidebar.html %}
    <div class="col">
  {% elsif sidebar.side == 'right' %}
  <div class="row">
    <div class="col">
  {% endif %}
  {%- comment -%} Loop rows {%- endcomment -%}
  {% assign rows = content | split: "<!--row-->" %}
  {%- for row in rows -%}
  <div class="row">
    {% assign j = forloop.index0 %}
    {%- comment -%} Loop columns {%- endcomment -%}
    {%- assign columns = row | split: "<!--column-->" -%}
    {%- for column in columns -%}
    <div class="col">
      {%- comment -%} Render column {%- endcomment -%}
      {% assign column_live = rows[j] | split: "<!--column-->" %}
      {{ column_live[forloop.index0] | strip }}
    </div>
    {% endfor %}
  </div>
  {%- endfor -%}
  {%- comment -%} Check sidebar right {%- endcomment -%}
  {% if sidebar.side == 'right' %}
    </div>
    {% include page/sidebar.html %}
  </div>
  {% elsif sidebar.side == 'left' %}
    </div>
  </div>
  {% endif %}
</main>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-any-theme-0.1.2 _includes/page/main.html
jekyll-any-theme-0.1.1 _includes/page/main.html
jekyll-any-theme-0.1.0 _includes/page/main.html