From d3e455a401163abbb16b3757dca6e0981110e788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20G=C3=B6rlich?= <73133626+koilebeit@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:37:17 +0100 Subject: [PATCH 1/2] Revert "fix timeline (#171)" (#173) This reverts commit 5f70da86a80c1a68dd8f6c11065967fdbab01cfc. --- _layouts/timeline_edtf.html | 32 +++++++++--------------- _plugins/jekyll_regex_match.rb | 30 ----------------------- _plugins/sort_edtf.rb | 45 +++------------------------------- 3 files changed, 15 insertions(+), 92 deletions(-) diff --git a/_layouts/timeline_edtf.html b/_layouts/timeline_edtf.html index 5a3efbc9..c1b19dc2 100644 --- a/_layouts/timeline_edtf.html +++ b/_layouts/timeline_edtf.html @@ -10,17 +10,16 @@ {% else %} {%- assign items = site.data[site.metadata] | where_exp: 'item', 'item.objectid and item.parentid == nil' -%} {% endif %} -{% assign regex = '[-]?[\dXu]{4,}' %} {%- assign items = items | where_exp: 'item', 'item[field]' -%} {%- assign raw-dates = items | map: field | compact | uniq -%} +{% assign regex = '[\dX]{4}' %} {%- capture clean-years -%}{% for date in raw-dates %}{{date | regex_match: regex | join: ';' }}{% unless forloop.last %};{% endunless %}{%- endfor -%}{%- endcapture -%} {%- assign uniqueYears = clean-years | remove: ' ' | replace: ';;', ';' | split: ';' | uniq | sort -%} -{% assign sorted_years = uniqueYears | sort_edtf %} {%- if site.data.theme['year-navigation'] -%} {%- assign navYears = site.data.theme['year-navigation'] | split: ';' -%} {%- elsif site.data.theme['year-nav-increment'] -%} {%- capture navYears -%} -{%- for i in sorted_years -%}{%- assign t = i | modulo: site.data.theme.year-nav-increment -%} +{%- for i in uniqueYears -%}{%- assign t = i | modulo: site.data.theme.year-nav-increment -%} {%- if t == 0 -%}{{ i }}{% unless forloop.last %};{% endunless %}{% endif %}{% endfor %}{%- endcapture -%} {%- assign navYears = navYears | split: ';' -%} {%- endif -%} @@ -38,13 +37,8 @@