mirror of
https://github.com/welpo/tabi.git
synced 2025-12-17 04:48:44 +01:00
Merge github.com:jerusdp/tabi into webmentions
This commit is contained in:
commit
6c6996b888
18 changed files with 169 additions and 22 deletions
|
|
@ -25,6 +25,13 @@
|
|||
{%- set_global all_posts = all_posts | concat(with=section_item.pages) -%}
|
||||
{%- endfor %}
|
||||
|
||||
{# Sort all posts by date #}
|
||||
{%- set archive_reverse = section.extra.archive_reverse | default(value=false) -%}
|
||||
{%- set all_posts = all_posts | sort(attribute="date") -%}
|
||||
{%- if not archive_reverse -%}
|
||||
{%- set all_posts = all_posts | reverse -%}
|
||||
{%- endif -%}
|
||||
|
||||
{# Group posts by year. #}
|
||||
{% set posts_by_year = all_posts | group_by(attribute="year") %}
|
||||
{% set years = [] %}
|
||||
|
|
@ -32,8 +39,13 @@
|
|||
{% set_global years = years | concat(with=[year]) %}
|
||||
{% endfor %}
|
||||
|
||||
{# Iterate over sorted & reversed years (newest to oldest). #}
|
||||
{% for year in years | sort | reverse %}
|
||||
{# Iterate over years #}
|
||||
{% set years = years | sort %}
|
||||
{%- if not archive_reverse -%}
|
||||
{%- set years = years | reverse -%}
|
||||
{%- endif -%}
|
||||
|
||||
{% for year in years %}
|
||||
{% set posts = posts_by_year[year] %}
|
||||
{% if posts | length > 0 %}
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@
|
|||
|
||||
{%- if "dates" in metadata -%}
|
||||
{%- set allowed_post_listing_dates = ["date", "updated", "both"] -%}
|
||||
{%- set post_listing_date = config.extra.post_listing_date | default(value="date") -%}
|
||||
{#- Calling the hierarchy macro here causes an error due to the "get parents" part of the macro. -#}
|
||||
{#- This seems cleaner. -#}
|
||||
{%- set post_listing_date = section.extra.post_listing_date | default(value=config.extra.post_listing_date) | default(value="date") -%}
|
||||
{%- if post_listing_date not in allowed_post_listing_dates -%}
|
||||
{{ throw(message="ERROR: Invalid value for config.extra.post_listing_date. Allowed values are 'date', 'updated', or 'both'.") }}
|
||||
{%- endif -%}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<link rel="icon" type="image/png" href="{{ get_url(path=config.extra.favicon) }}"/>
|
||||
{% endif %}
|
||||
{% if config.extra.favicon_emoji %}
|
||||
<link rel=icon href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 55"><text y=".7em" font-size="82">{{ config.extra.favicon_emoji }}</text></svg>'>
|
||||
<link rel=icon href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50%" x="50%" dominant-baseline="central" text-anchor="middle" font-size="88">{{ config.extra.favicon_emoji }}</text></svg>'>
|
||||
{% endif %}
|
||||
|
||||
{# Feeds #}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
<main {% if more_than_one_section_shown %}class="{{ first_section }}-first"{% endif %}>
|
||||
{%- if section.extra.header %}
|
||||
{%- include "partials/home_banner.html" -%}
|
||||
{%- elif section.content -%}
|
||||
<section>
|
||||
{{ section.content | safe }}
|
||||
</section>
|
||||
{% endif -%}
|
||||
|
||||
{% if section.extra.section_path -%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue