Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set main language in Jekyll

How can I change the default language in Jekyll? I would like, to have German names for the days using the {{ … | date "%A" }} filter.

like image 374
white_gecko Avatar asked Jan 22 '26 12:01

white_gecko


1 Answers

From Jekyll Date Formatting Examples by Alan Smith

_includes/date-ge.html

<!-- Whitespace added for readability -->
{% assign m = include.date | date: "%-m" %}
{{ include.date | date: "%-d" }}
{% case m %}
  {% when '1' %}Januar
  {% when '2' %}Februar
  {% when '3' %}M&auml;rz
  {% when '4' %}April
  {% when '5' %}Mai
  {% when '6' %}Juni
  {% when '7' %}Juli
  {% when '8' %}August
  {% when '9' %}September
  {% when '10' %}Oktober
  {% when '11' %}November
  {% when '12' %}Dezember
{% endcase %}
{{ include.date | date: "%Y" }}

Now instead of page.date or post.date you can call this include and pass it date as an argument.

{% include date-ge.html date=page.date %}
like image 136
David Jacquel Avatar answered Jan 27 '26 02:01

David Jacquel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!