forked from paperswithcode/ai-deadlines
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Microformats2 in RSS and improved date formatting
- Loading branch information
1 parent
065f041
commit e5e916e
Showing
7 changed files
with
228 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,49 @@ | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
{%- if start_date == end_date -%} | ||
{%- comment -%}When start and end dates are the same{%- endcomment -%} | ||
{% assign day = start_date | date: "%-d" -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{%- capture pretty_date -%} | ||
{{- day -}}. {{- month -}} {{- year -}} | ||
{%- endcapture -%} | ||
{%- elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%} | ||
{%- comment -%}When start and end dates are in the same month{%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{- start_day -}}. – {{- end_day -}}. {{- month -}} {{- year -}} | ||
{%- endcapture -%} | ||
{%- elsif start_date | date: "%Y" == end_date | date: "%Y" -%} | ||
{%- comment -%}When start and end dates are in the same year{%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% if include.start == nil and include.end == nil -%} | ||
{% capture pretty_date %}{% t "times.tba" %}{% endcapture -%} | ||
{% elsif include.start == nil -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{%- t "times.months.{{- end_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{- start_day -}}. {{- start_month -}} – {{- end_day -}}. {{- end_month -}} {{- year -}} | ||
{%- endcapture -%} | ||
{%- else -%} | ||
{%- comment -%}When start and end dates are in different years{%- endcomment -%} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{% capture pretty_date %}{% t "times.until" %} {{ end_day }}. {{ end_month }} {{ end_year }}{% endcapture -%} | ||
{% elsif include.end == nil -%} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{%- t "times.months.{{- end_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign start_year = start_date | date: "%Y" -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{-start_day-}}. {{- start_month-}} {{- start_year -}} – {{- end_day -}}. {{- end_month -}} {{- end_year -}} | ||
{%- endcapture -%} | ||
{%- endif -%}{{- pretty_date | strip -}} | ||
{% capture pretty_date %}{% t "times.from" %} {{ start_day }}. {{ start_month }} {{ start_year }}{% endcapture -%} | ||
{% else -%} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
|
||
{% if start_date == end_date -%} | ||
{% assign day = start_date | date: "%-d" -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture pretty_date %}{{ day }}. {{ month }} {{ year }}{% endcapture -%} | ||
|
||
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture pretty_date %}{{ start_day }}. – {{ end_day }}. {{ month }} {{ year }}{% endcapture -%} | ||
|
||
{% elsif start_date | date: "%Y" == end_date | date: "%Y" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture pretty_date %}{{ start_day }}. {{ start_month }} – {{ end_day }}. {{ end_month }} {{ year }}{% endcapture -%} | ||
|
||
{% else -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign start_year = start_date | date: "%Y" -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{% capture pretty_date %}{{ start_day }}. {{ start_month }} {{ start_year }} – {{ end_day }}. {{ end_month }} {{ end_year }}{% endcapture -%} | ||
{% endif -%} | ||
{% endif -%}{{ pretty_date | strip }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
{% if start_date == end_date %} | ||
{%- comment -%}When start and end dates are the same{%- endcomment -%} | ||
{% assign day = start_date | date: "%-d" %} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture month -%} | ||
{% t "times.months.{{ start_date | date: "%B" }}" %} | ||
{%- endcapture -%} | ||
{%- capture pretty_date -%} | ||
{{ month }} {{ day }}, {{ year }} | ||
{%- endcapture -%} | ||
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" %} | ||
{%- comment -%}When start and end dates are in the same month{% endcomment %} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture month %} | ||
{%- t "times.months.{{ start_date | date: "%B" }}" -%} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{ month }} {{ start_day }} – {{ end_day }}, {{ year }} | ||
{%- endcapture -%} | ||
{% elsif start_date | date: "%Y" == end_date | date: "%Y" %} | ||
{%- comment -%}When start and end dates are in the same year{%- endcomment -%} | ||
{% if include.start == nil and include.end == nil %} | ||
{% capture pretty_date %}{% t "times.tba" %}{% endcapture %} | ||
{% elsif include.start == nil %} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" %} | ||
{% assign end_day = end_date | date: "%-d" %} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %} | ||
{% assign end_year = end_date | date: "%Y" %} | ||
{% capture pretty_date %}{% t "times.until" %} {{ end_month }} {{ end_day }}, {{ end_year }}{% endcapture %} | ||
{% elsif include.end == nil %} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" %} | ||
{% assign start_day = start_date | date: "%-d" %} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{% t "times.months.{{ start_date | date: "%B" }}" %} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{% t "times.months.{{ end_date | date: "%B" }}" %} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{ start_month }} {{ start_day }} – {{ end_month }} {{ end_day }}, {{ year }} | ||
{%- endcapture -%} | ||
{%- else -%} | ||
{%- comment -%}When start and end dates are in different years{%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{%- t "times.months.{{ start_date | date: "%B" }}" -%} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{%- t "times.months.{{ end_date | date: "%B" }}" -%} | ||
{%- endcapture -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %} | ||
{% assign start_year = start_date | date: "%Y" %} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{ start_month}} {{start_day}}, {{ start_year }} – {{ end_month }} {{ end_day }}, {{ end_year }} | ||
{%- endcapture -%} | ||
{%- endif -%}{{pretty_date | strip }} | ||
{% capture pretty_date %}{% t "times.from" %} {{ start_month }} {{ start_day }}, {{ start_year }}{% endcapture %} | ||
{% else %} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" %} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" %} | ||
|
||
{% if start_date == end_date %} | ||
{%- comment -%}When start and end dates are the same{%- endcomment -%} | ||
{% assign day = start_date | date: "%-d" %} | ||
{% assign year = start_date | date: "%Y" %} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %} | ||
{% capture pretty_date %}{{ month }} {{ day }}, {{ year }}{% endcapture %} | ||
|
||
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" %} | ||
{%- comment -%}When start and end dates are in the same month{% endcomment %} | ||
{% assign start_day = start_date | date: "%-d" %} | ||
{% assign end_day = end_date | date: "%-d" %} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %} | ||
{% assign year = start_date | date: "%Y" %} | ||
{% capture pretty_date %}{{ month }} {{ start_day }} – {{ end_day }}, {{ year }}{% endcapture %} | ||
|
||
{% elsif start_date | date: "%Y" == end_date | date: "%Y" %} | ||
{%- comment -%}When start and end dates are in the same year{%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" %} | ||
{% assign end_day = end_date | date: "%-d" %} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %} | ||
{% assign year = start_date | date: "%Y" %} | ||
{% capture pretty_date %}{{ start_month }} {{ start_day }} – {{ end_month }} {{ end_day }}, {{ year }}{% endcapture %} | ||
|
||
{% else %} | ||
{%- comment -%}When start and end dates are in different years{%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" %} | ||
{% assign end_day = end_date | date: "%-d" %} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture %} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture %} | ||
{% assign start_year = start_date | date: "%Y" %} | ||
{% assign end_year = end_date | date: "%Y" %} | ||
{% capture pretty_date %}{{ start_month}} {{start_day}}, {{ start_year }} – {{ end_month }} {{ end_day }}, {{ end_year }}{% endcapture %} | ||
{% endif %} | ||
{% endif %}{{pretty_date | strip }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,49 @@ | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
{%- if start_date == end_date -%} | ||
{%- comment -%} When start and end dates are the same {%- endcomment -%} | ||
{% assign day = start_date | date: "%-d" %} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture month -%} | ||
{%- t "times.months.{{ start_date | date: "%B" }}" -%} | ||
{%- endcapture -%} | ||
{%- capture pretty_date -%} | ||
{{- day -}} de {{- month -}} de {{- year -}} | ||
{%- endcapture -%} | ||
{%- elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%} | ||
{%- comment -%} When start and end dates are in the same month {% endcomment %} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% if include.start == nil and include.end == nil -%} | ||
{% capture pretty_date %}{% t "times.tba" %}{% endcapture -%} | ||
{% elsif include.start == nil -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{- start_day -}} – {{- end_day -}} de {{- month -}} de {{- year -}} | ||
{%- endcapture -%} | ||
{%- elsif start_date | date: "%Y" == end_date | date: "%Y" -%} | ||
{%- comment -%} When start and end dates are in the same year {% endcomment %} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{% capture pretty_date %}{% t "times.until" %} el {{ end_day }} de {{ end_month }} de {{ end_year }}{% endcapture -%} | ||
{% elsif include.end == nil -%} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{%- t "times.months.{{- start_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{%- t "times.months.{{- end_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{- start_day -}} de {{- start_month -}} – {{- end_day -}} de {{- end_month -}} de {{- year -}} | ||
{%- endcapture -%} | ||
{%- else -%} | ||
{%- comment -%} When start and end dates are in different years {%- endcomment -%} | ||
{% assign start_day = start_date | date: "%-d" %} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{%- capture start_month -%} | ||
{%- t "times.months.{{ start_date | date: "%B" }}" -%} | ||
{%- endcapture -%} | ||
{%- capture end_month -%} | ||
{%- t "times.months.{{- end_date | date: "%B" -}}" -%} | ||
{%- endcapture -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign start_year = start_date | date: "%Y" -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{%- capture pretty_date -%} | ||
{{-start_day-}} de {{- start_month-}} de {{- start_year -}} – {{- end_day -}} de {{- end_month -}} de {{ end_year }} | ||
{%- endcapture -%} | ||
{%- endif -%}{{- pretty_date | strip -}} | ||
{% capture pretty_date %}{% t "times.from" %} el {{ start_day }} de {{ start_month }} de {{ start_year }}{% endcapture -%} | ||
{% else -%} | ||
{% assign start_date = include.start | date: "%Y-%m-%d" -%} | ||
{% assign end_date = include.end | date: "%Y-%m-%d" -%} | ||
|
||
{% if start_date == end_date -%} | ||
{% assign day = start_date | date: "%-d" -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture pretty_date %}{{ day }} de {{ month }} de {{ year }}{% endcapture -%} | ||
|
||
{% elsif start_date | date: "%Y-%m" == end_date | date: "%Y-%m" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture pretty_date %}del {{ start_day }} al {{ end_day }} de {{ month }} de {{ year }}{% endcapture -%} | ||
|
||
{% elsif start_date | date: "%Y" == end_date | date: "%Y" -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign year = start_date | date: "%Y" -%} | ||
{% capture pretty_date %}del {{ start_day }} de {{ start_month }} al {{ end_day }} de {{ end_month }} de {{ year }}{% endcapture -%} | ||
|
||
{% else -%} | ||
{% assign start_day = start_date | date: "%-d" -%} | ||
{% assign end_day = end_date | date: "%-d" -%} | ||
{% capture start_month %}{% t "times.months.{{ start_date | date: '%B' }}" %}{% endcapture -%} | ||
{% capture end_month %}{% t "times.months.{{ end_date | date: '%B' }}" %}{% endcapture -%} | ||
{% assign start_year = start_date | date: "%Y" -%} | ||
{% assign end_year = end_date | date: "%Y" -%} | ||
{% capture pretty_date %}del {{ start_day }} de {{ start_month }} de {{ start_year }} al {{ end_day }} de {{ end_month }} de {{ end_year }}{% endcapture -%} | ||
{% endif -%} | ||
{% endif -%}{{ pretty_date | strip }} |
Oops, something went wrong.