aboutsummaryrefslogtreecommitdiff
path: root/_includes/i18n-date.html
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-12 12:06:07 -0300
committerEuAndreh <eu@euandre.org>2020-08-12 12:06:07 -0300
commit3720c8b0146c10a63dc1d9eba0556e0a67adfd1d (patch)
tree463e3dc33553c05f85275617617f342cb20f38ab /_includes/i18n-date.html
parentscripts/assert-content.sh: Add check for missing title (diff)
downloadeuandre.org-3720c8b0146c10a63dc1d9eba0556e0a67adfd1d.tar.gz
euandre.org-3720c8b0146c10a63dc1d9eba0556e0a67adfd1d.tar.xz
Use _includes/i18n-date.html for dates
Diffstat (limited to '_includes/i18n-date.html')
-rw-r--r--_includes/i18n-date.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/_includes/i18n-date.html b/_includes/i18n-date.html
new file mode 100644
index 0000000..9b73600
--- /dev/null
+++ b/_includes/i18n-date.html
@@ -0,0 +1,11 @@
+{% capture i18n_month %}
+{% assign m = include.date | date: "%-m" | minus: 1 %}
+{{ site.t.months[page.lang][m] }}
+{% endcapture %}
+{% if page.lang == "en" %}
+ <!-- handcrafting the "%B %-d, %Y" date format -->
+ {{ i18n_month }}{{ include.date | date: "%-d, %Y" }}
+{% elsif page.lang == "pt" %}
+ <!-- handcrafting the "%-d de %B de %Y" date format -->
+ {{ include.date | date: "%-d de " }}{{ i18n_month }}{{ include.date | date: " de %Y" }}
+{% endif %}