aboutsummaryrefslogtreecommitdiff
path: root/templates/index.html
blob: f0740fe64426db35d7f33122bc4c524b56b8f125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{% import "macros/page.html" as page_macros %}
{% import "macros/macros.html" as macros %}
{% extends "base.html" %}
{% block content %}
  <div>
    {% for page in paginator.pages %}
      <article>
        {{ macros::title(page=page) }}
        <p>
          {% if page.summary -%}
            {{ page.summary | markdown(inline=true) | safe }}
          {% elif page.description %}
            {{ page.description | safe }}
          {% elif page.content %}
            {{ page.content | safe | striptags | truncate(length=150) }}
          {% elif page.extra.static_thumbnail %}
          {% endif -%}
          <a href="{{ page.permalink | safe }}">...more</a>
        </p>
      </article>
    {% endfor %}
    <nav>
      {% if paginator.previous %}<a href="{{ paginator.previous | safe }}">&#60; Previous</a> {% endif %}{% if paginator.next %}<a href="{{ paginator.next | safe }}">Next &#62;</a>{% endif %}
    </nav>
  </div>
  {% set section_item = get_section(path="_index.md") %}
  {% if config.extra.recent | default(value=true) %}
    <div class="toc">
      <div class="toc-sticky">
        <h3>Recent Posts</h3>
        {% for page in section_item.pages | slice(end=config.extra.recent_items) %}
          {{ page_macros::page_listing(page=page) }}
        {% endfor %}
      </div>
    </div>
  {% endif %}
{% endblock content %}