aboutsummaryrefslogtreecommitdiff
path: root/templates/posts.html
blob: e4f1d547fb78b9f63b2f71f54cd8841136746e6f (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
{# This Page Shows the Posts Grouped by Year: example.com/posts/ #}

{% extends "base.html" %}

{%- block seo %}
  {{- super() }}
  {%- set title = "Posts" %}

  {%- if config.title %}
    {%- set title_addition = title_separator ~ config.title %}
  {%- else %}
    {%- set title_addition = "" %}
  {%- endif %}

  {%- set description = config.description %}

  {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}

{%- block content %}
{%- set section_item = get_section(path="_index.md") %}
    <div>
      {%- for year, posts in section_item.pages | group_by(attribute="year") %}
      <h2>{{ year }}</h2>
      {%- for post in posts %}
      <p><a href="{{ post.permalink | safe }}" title="{{ post.title }}">{{ post.title }}</a> - <time datetime="{{ post.date }}">{{ post.date | date(format="%F") }}</time></p>
      {%- endfor %}
      {%- endfor %}
    </div>
{%- endblock content %}