Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial archive page #2636

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ taxonomies = [
highlight_code = true
highlight_theme = "visual-studio-dark"

lazy_async_image = true

[link_checker]
skip_prefixes = [
# This page is not a real page. You need to open https://circu.li/fdroid/repo/index-v1.json for a response
Expand All @@ -49,4 +51,3 @@ conference_location = "Berlin, Germany"

governence_board_elections = false
governence_board_elections_page = "/governing-board/elections/2024"

3 changes: 3 additions & 0 deletions content/blog/archive/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
template = "archive.html"
+++
56 changes: 56 additions & 0 deletions templates/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% extends "section.html" %}
{% block content -%}
{% set blog_section = get_section(path="blog/_index.md") %}
<div class="content">
{% set_global all_pages = [] %}

{% for year_section_name in blog_section.subsections %}
{% set year_section = get_section(path=year_section_name) %}
{% set_global all_pages = all_pages | concat(with=year_section.pages) %}
{% endfor %}
{% set posts_by_year = all_pages | group_by(attribute="year") %}

{% set_global years = [] %}
{% for year, ignored in posts_by_year %}
{% set_global years = years | concat(with=year) %}
{% endfor %}

{% for year in years | sort | reverse %}
{% set posts = posts_by_year[year] | sort(attribute="date") | reverse %}
<h1>{{ year }}</h1>
<hr />
{% for page in posts %}
<article class="post">
<header>
<h1><a href="{{ page.permalink }}" title="{{ page.title }}">{{ page.title }}</a></h1>
<span>
{{ page.date | date(format="%d.%m.%Y %H:%M") }}
{% if page.taxonomies.category -%}
{% for category in page.taxonomies.category %}
<a href="/category/{{ category | slugify }}">
{{- category -}}
</a>
{%- if not loop.last %}, {% endif %}{% endfor %}
{% endif %}
{% for author in page.taxonomies.author %}
<a href="/author/{{ author | default(value=['unknown author']) | slugify }}">
{{- author | default(value=["unknown author"]) -}}
</a>
{%- if not loop.last %}, {% endif %}
{% endfor %}
</span>
{% if page.updated -%}
<br>
<small>Last update: {{ page.updated | date(format="%d.%m.%Y %H:%M") }}</small>
{%- endif %}
</header>
<div>
{{ page.content | safe }}
</div>
</article>
{% endfor %}
{% endfor %}
</div>
{%- endblock content %}
2 changes: 1 addition & 1 deletion templates/shortcodes/figure.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<figure style="height:100%;">
<img src="{{ img }}" alt="{{ caption }}" />
<img decoding="async" loading="lazy" src="{{ img }}" alt="{{ caption }}" />
<figcaption>{{ caption | markdown | safe }}</figcaption>
</figure>