Skip to content

Commit e5e916e

Browse files
committed
Feat: Microformats2 in RSS and improved date formatting
1 parent 065f041 commit e5e916e

File tree

7 files changed

+228
-177
lines changed

7 files changed

+228
-177
lines changed

_i18n/de.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ series:
6565
last: 'Letztes Jahr in'
6666
next: 'Nächstes Jahr in'
6767
times:
68+
tba: "Wird bekannt gegeben"
69+
from: "Ab"
70+
until: "Bis"
6871
normal:
6972
days: 'Tage'
7073
hours: 'Stunden'

_i18n/de/dates/pretty_dates.html

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
1-
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
2-
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
3-
{%- if start_date == end_date -%}
4-
{%- comment -%}When start and end dates are the same{%- endcomment -%}
5-
{% assign day = start_date | date: "%-d" -%}
6-
{% assign year = start_date | date: "%Y" -%}
7-
{%- capture month -%}
8-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
9-
{%- endcapture -%}
10-
{%- capture pretty_date -%}
11-
{{- day -}}. {{- month -}} {{- year -}}
12-
{%- endcapture -%}
13-
{%- elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%}
14-
{%- comment -%}When start and end dates are in the same month{%- endcomment -%}
15-
{% assign start_day = start_date | date: "%-d" -%}
16-
{% assign end_day = end_date | date: "%-d" -%}
17-
{%- capture month -%}
18-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
19-
{%- endcapture -%}
20-
{% assign year = start_date | date: "%Y" -%}
21-
{%- capture pretty_date -%}
22-
{{- start_day -}}. – {{- end_day -}}. {{- month -}} {{- year -}}
23-
{%- endcapture -%}
24-
{%- elsif start_date | date: "%Y" == end_date | date: "%Y" -%}
25-
{%- comment -%}When start and end dates are in the same year{%- endcomment -%}
26-
{% assign start_day = start_date | date: "%-d" -%}
1+
{% if include.start == nil and include.end == nil -%}
2+
{% capture pretty_date %}{% t "times.tba" %}{% endcapture -%}
3+
{% elsif include.start == nil -%}
4+
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
275
{% assign end_day = end_date | date: "%-d" -%}
28-
{%- capture start_month -%}
29-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
30-
{%- endcapture -%}
31-
{%- capture end_month -%}
32-
{%- t "times.months.{{- end_date | date: "%B" -}}" -%}
33-
{%- endcapture -%}
34-
{% assign year = start_date | date: "%Y" -%}
35-
{%- capture pretty_date -%}
36-
{{- start_day -}}. {{- start_month -}} – {{- end_day -}}. {{- end_month -}} {{- year -}}
37-
{%- endcapture -%}
38-
{%- else -%}
39-
{%- comment -%}When start and end dates are in different years{%- endcomment -%}
6+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
7+
{% assign end_year = end_date | date: "%Y" -%}
8+
{% capture pretty_date %}{% t "times.until" %} {{ end_day }}. {{ end_month }} {{ end_year }}{% endcapture -%}
9+
{% elsif include.end == nil -%}
10+
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
4011
{% assign start_day = start_date | date: "%-d" -%}
41-
{% assign end_day = end_date | date: "%-d" -%}
42-
{%- capture start_month -%}
43-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
44-
{%- endcapture -%}
45-
{%- capture end_month -%}
46-
{%- t "times.months.{{- end_date | date: "%B" -}}" -%}
47-
{%- endcapture -%}
12+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
4813
{% assign start_year = start_date | date: "%Y" -%}
49-
{% assign end_year = end_date | date: "%Y" -%}
50-
{%- capture pretty_date -%}
51-
{{-start_day-}}. {{- start_month-}} {{- start_year -}} – {{- end_day -}}. {{- end_month -}} {{- end_year -}}
52-
{%- endcapture -%}
53-
{%- endif -%}{{- pretty_date | strip -}}
14+
{% capture pretty_date %}{% t "times.from" %} {{ start_day }}. {{ start_month }} {{ start_year }}{% endcapture -%}
15+
{% else -%}
16+
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
17+
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
18+
19+
{% if start_date == end_date -%}
20+
{% assign day = start_date | date: "%-d" -%}
21+
{% assign year = start_date | date: "%Y" -%}
22+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
23+
{% capture pretty_date %}{{ day }}. {{ month }} {{ year }}{% endcapture -%}
24+
25+
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%}
26+
{% assign start_day = start_date | date: "%-d" -%}
27+
{% assign end_day = end_date | date: "%-d" -%}
28+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
29+
{% assign year = start_date | date: "%Y" -%}
30+
{% capture pretty_date %}{{ start_day }}. – {{ end_day }}. {{ month }} {{ year }}{% endcapture -%}
31+
32+
{% elsif start_date | date: "%Y" == end_date | date: "%Y" -%}
33+
{% assign start_day = start_date | date: "%-d" -%}
34+
{% assign end_day = end_date | date: "%-d" -%}
35+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
36+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
37+
{% assign year = start_date | date: "%Y" -%}
38+
{% capture pretty_date %}{{ start_day }}. {{ start_month }} – {{ end_day }}. {{ end_month }} {{ year }}{% endcapture -%}
39+
40+
{% else -%}
41+
{% assign start_day = start_date | date: "%-d" -%}
42+
{% assign end_day = end_date | date: "%-d" -%}
43+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
44+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
45+
{% assign start_year = start_date | date: "%Y" -%}
46+
{% assign end_year = end_date | date: "%Y" -%}
47+
{% capture pretty_date %}{{ start_day }}. {{ start_month }} {{ start_year }} – {{ end_day }}. {{ end_month }} {{ end_year }}{% endcapture -%}
48+
{% endif -%}
49+
{% endif -%}{{ pretty_date | strip }}

_i18n/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ series:
6565
last: 'Last year held in'
6666
next: 'Next year held in'
6767
times:
68+
tba: "TBA"
69+
from: "From"
70+
until: "Until"
6871
normal:
6972
days: 'days'
7073
hours: 'hours'

_i18n/en/dates/pretty_dates.html

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
2-
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
3-
{% if start_date == end_date %}
4-
{%- comment -%}When start and end dates are the same{%- endcomment -%}
5-
{% assign day = start_date | date: "%-d" %}
6-
{% assign year = start_date | date: "%Y" -%}
7-
{%- capture month -%}
8-
{% t "times.months.{{ start_date | date: "%B" }}" %}
9-
{%- endcapture -%}
10-
{%- capture pretty_date -%}
11-
{{ month }} {{ day }}, {{ year }}
12-
{%- endcapture -%}
13-
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" %}
14-
{%- comment -%}When start and end dates are in the same month{% endcomment %}
15-
{% assign start_day = start_date | date: "%-d" -%}
16-
{% assign end_day = end_date | date: "%-d" -%}
17-
{% capture month %}
18-
{%- t "times.months.{{ start_date | date: "%B" }}" -%}
19-
{%- endcapture -%}
20-
{% assign year = start_date | date: "%Y" -%}
21-
{%- capture pretty_date -%}
22-
{{ month }} {{ start_day }} – {{ end_day }}, {{ year }}
23-
{%- endcapture -%}
24-
{% elsif start_date | date: "%Y" == end_date | date: "%Y" %}
25-
{%- comment -%}When start and end dates are in the same year{%- endcomment -%}
1+
{% if include.start == nil and include.end == nil %}
2+
{% capture pretty_date %}{% t "times.tba" %}{% endcapture %}
3+
{% elsif include.start == nil %}
4+
{% assign end_date = include.end | date: "%Y-%m-%d" %}
5+
{% assign end_day = end_date | date: "%-d" %}
6+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %}
7+
{% assign end_year = end_date | date: "%Y" %}
8+
{% capture pretty_date %}{% t "times.until" %} {{ end_month }} {{ end_day }}, {{ end_year }}{% endcapture %}
9+
{% elsif include.end == nil %}
10+
{% assign start_date = include.start | date: "%Y-%m-%d" %}
2611
{% assign start_day = start_date | date: "%-d" %}
27-
{% assign end_day = end_date | date: "%-d" -%}
28-
{%- capture start_month -%}
29-
{% t "times.months.{{ start_date | date: "%B" }}" %}
30-
{%- endcapture -%}
31-
{%- capture end_month -%}
32-
{% t "times.months.{{ end_date | date: "%B" }}" %}
33-
{%- endcapture -%}
34-
{% assign year = start_date | date: "%Y" -%}
35-
{%- capture pretty_date -%}
36-
{{ start_month }} {{ start_day }} – {{ end_month }} {{ end_day }}, {{ year }}
37-
{%- endcapture -%}
38-
{%- else -%}
39-
{%- comment -%}When start and end dates are in different years{%- endcomment -%}
40-
{% assign start_day = start_date | date: "%-d" -%}
41-
{% assign end_day = end_date | date: "%-d" -%}
42-
{%- capture start_month -%}
43-
{%- t "times.months.{{ start_date | date: "%B" }}" -%}
44-
{%- endcapture -%}
45-
{%- capture end_month -%}
46-
{%- t "times.months.{{ end_date | date: "%B" }}" -%}
47-
{%- endcapture -%}
12+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %}
4813
{% assign start_year = start_date | date: "%Y" %}
49-
{% assign end_year = end_date | date: "%Y" -%}
50-
{%- capture pretty_date -%}
51-
{{ start_month}} {{start_day}}, {{ start_year }} – {{ end_month }} {{ end_day }}, {{ end_year }}
52-
{%- endcapture -%}
53-
{%- endif -%}{{pretty_date | strip }}
14+
{% capture pretty_date %}{% t "times.from" %} {{ start_month }} {{ start_day }}, {{ start_year }}{% endcapture %}
15+
{% else %}
16+
{% assign start_date = include.start | date: "%Y-%m-%d" %}
17+
{% assign end_date = include.end | date: "%Y-%m-%d" %}
18+
19+
{% if start_date == end_date %}
20+
{%- comment -%}When start and end dates are the same{%- endcomment -%}
21+
{% assign day = start_date | date: "%-d" %}
22+
{% assign year = start_date | date: "%Y" %}
23+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %}
24+
{% capture pretty_date %}{{ month }} {{ day }}, {{ year }}{% endcapture %}
25+
26+
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" %}
27+
{%- comment -%}When start and end dates are in the same month{% endcomment %}
28+
{% assign start_day = start_date | date: "%-d" %}
29+
{% assign end_day = end_date | date: "%-d" %}
30+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %}
31+
{% assign year = start_date | date: "%Y" %}
32+
{% capture pretty_date %}{{ month }} {{ start_day }} – {{ end_day }}, {{ year }}{% endcapture %}
33+
34+
{% elsif start_date | date: "%Y" == end_date | date: "%Y" %}
35+
{%- comment -%}When start and end dates are in the same year{%- endcomment -%}
36+
{% assign start_day = start_date | date: "%-d" %}
37+
{% assign end_day = end_date | date: "%-d" %}
38+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %}
39+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %}
40+
{% assign year = start_date | date: "%Y" %}
41+
{% capture pretty_date %}{{ start_month }} {{ start_day }} – {{ end_month }} {{ end_day }}, {{ year }}{% endcapture %}
42+
43+
{% else %}
44+
{%- comment -%}When start and end dates are in different years{%- endcomment -%}
45+
{% assign start_day = start_date | date: "%-d" %}
46+
{% assign end_day = end_date | date: "%-d" %}
47+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %}
48+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %}
49+
{% assign start_year = start_date | date: "%Y" %}
50+
{% assign end_year = end_date | date: "%Y" %}
51+
{% capture pretty_date %}{{ start_month}} {{start_day}}, {{ start_year }} – {{ end_month }} {{ end_day }}, {{ end_year }}{% endcapture %}
52+
{% endif %}
53+
{% endif %}{{pretty_date | strip }}

_i18n/es.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ series:
6565
last: 'Ùltimo año en'
6666
next: 'Próximo año en'
6767
times:
68+
tba: "Por anunciar"
69+
from: "Desde"
70+
until: "Hasta"
6871
normal:
6972
days: 'dias'
7073
hours: 'horas'

_i18n/es/dates/pretty_dates.html

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
1-
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
2-
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
3-
{%- if start_date == end_date -%}
4-
{%- comment -%} When start and end dates are the same {%- endcomment -%}
5-
{% assign day = start_date | date: "%-d" %}
6-
{% assign year = start_date | date: "%Y" -%}
7-
{%- capture month -%}
8-
{%- t "times.months.{{ start_date | date: "%B" }}" -%}
9-
{%- endcapture -%}
10-
{%- capture pretty_date -%}
11-
{{- day -}} de {{- month -}} de {{- year -}}
12-
{%- endcapture -%}
13-
{%- elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%}
14-
{%- comment -%} When start and end dates are in the same month {% endcomment %}
15-
{% assign start_day = start_date | date: "%-d" -%}
1+
{% if include.start == nil and include.end == nil -%}
2+
{% capture pretty_date %}{% t "times.tba" %}{% endcapture -%}
3+
{% elsif include.start == nil -%}
4+
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
165
{% assign end_day = end_date | date: "%-d" -%}
17-
{%- capture month -%}
18-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
19-
{%- endcapture -%}
20-
{% assign year = start_date | date: "%Y" -%}
21-
{%- capture pretty_date -%}
22-
{{- start_day -}} – {{- end_day -}} de {{- month -}} de {{- year -}}
23-
{%- endcapture -%}
24-
{%- elsif start_date | date: "%Y" == end_date | date: "%Y" -%}
25-
{%- comment -%} When start and end dates are in the same year {% endcomment %}
6+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
7+
{% assign end_year = end_date | date: "%Y" -%}
8+
{% capture pretty_date %}{% t "times.until" %} el {{ end_day }} de {{ end_month }} de {{ end_year }}{% endcapture -%}
9+
{% elsif include.end == nil -%}
10+
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
2611
{% assign start_day = start_date | date: "%-d" -%}
27-
{% assign end_day = end_date | date: "%-d" -%}
28-
{%- capture start_month -%}
29-
{%- t "times.months.{{- start_date | date: "%B" -}}" -%}
30-
{%- endcapture -%}
31-
{%- capture end_month -%}
32-
{%- t "times.months.{{- end_date | date: "%B" -}}" -%}
33-
{%- endcapture -%}
34-
{% assign year = start_date | date: "%Y" -%}
35-
{%- capture pretty_date -%}
36-
{{- start_day -}} de {{- start_month -}} – {{- end_day -}} de {{- end_month -}} de {{- year -}}
37-
{%- endcapture -%}
38-
{%- else -%}
39-
{%- comment -%} When start and end dates are in different years {%- endcomment -%}
40-
{% assign start_day = start_date | date: "%-d" %}
41-
{% assign end_day = end_date | date: "%-d" -%}
42-
{%- capture start_month -%}
43-
{%- t "times.months.{{ start_date | date: "%B" }}" -%}
44-
{%- endcapture -%}
45-
{%- capture end_month -%}
46-
{%- t "times.months.{{- end_date | date: "%B" -}}" -%}
47-
{%- endcapture -%}
12+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
4813
{% assign start_year = start_date | date: "%Y" -%}
49-
{% assign end_year = end_date | date: "%Y" -%}
50-
{%- capture pretty_date -%}
51-
{{-start_day-}} de {{- start_month-}} de {{- start_year -}} – {{- end_day -}} de {{- end_month -}} de {{ end_year }}
52-
{%- endcapture -%}
53-
{%- endif -%}{{- pretty_date | strip -}}
14+
{% capture pretty_date %}{% t "times.from" %} el {{ start_day }} de {{ start_month }} de {{ start_year }}{% endcapture -%}
15+
{% else -%}
16+
{% assign start_date = include.start | date: "%Y-%m-%d" -%}
17+
{% assign end_date = include.end | date: "%Y-%m-%d" -%}
18+
19+
{% if start_date == end_date -%}
20+
{% assign day = start_date | date: "%-d" -%}
21+
{% assign year = start_date | date: "%Y" -%}
22+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
23+
{% capture pretty_date %}{{ day }} de {{ month }} de {{ year }}{% endcapture -%}
24+
25+
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%}
26+
{% assign start_day = start_date | date: "%-d" -%}
27+
{% assign end_day = end_date | date: "%-d" -%}
28+
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
29+
{% assign year = start_date | date: "%Y" -%}
30+
{% capture pretty_date %}del {{ start_day }} al {{ end_day }} de {{ month }} de {{ year }}{% endcapture -%}
31+
32+
{% elsif start_date | date: "%Y" == end_date | date: "%Y" -%}
33+
{% assign start_day = start_date | date: "%-d" -%}
34+
{% assign end_day = end_date | date: "%-d" -%}
35+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
36+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
37+
{% assign year = start_date | date: "%Y" -%}
38+
{% capture pretty_date %}del {{ start_day }} de {{ start_month }} al {{ end_day }} de {{ end_month }} de {{ year }}{% endcapture -%}
39+
40+
{% else -%}
41+
{% assign start_day = start_date | date: "%-d" -%}
42+
{% assign end_day = end_date | date: "%-d" -%}
43+
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%}
44+
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%}
45+
{% assign start_year = start_date | date: "%Y" -%}
46+
{% assign end_year = end_date | date: "%Y" -%}
47+
{% capture pretty_date %}del {{ start_day }} de {{ start_month }} de {{ start_year }} al {{ end_day }} de {{ end_month }} de {{ end_year }}{% endcapture -%}
48+
{% endif -%}
49+
{% endif -%}{{ pretty_date | strip }}

0 commit comments

Comments
 (0)