Skip to content

Instantly share code, notes, and snippets.

@KittyGiraudel
Last active February 24, 2018 10:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KittyGiraudel/9755b37f7ec005f7e7a7 to your computer and use it in GitHub Desktop.
Save KittyGiraudel/9755b37f7ec005f7e7a7 to your computer and use it in GitHub Desktop.
Here is an easy way to handle i18n in a Jekyll website.
# _data/en.yml
header:
title: "Hello world!"
<!-- index.html -->
---
lang: fr
---
{% include header.html %}
# _data/fr.yml
header:
title: "Bonjour le monde!"
<!-- _includes/header.html -->
<h1>{{ site.data[page.lang].header.title }}</h1>
<!-- index.html -->
---
lang: en
---
{% include header.html %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment