kurtsson/jekyll-multiple-languages-plugin

Compatibility with jekyll-seo-tag

josephgarnier opened this issue · 2 comments

Hi,

I created a template like this :

id: about
layout: page
title: pages.about.title
display-title: true
permalink: /about
button: true
order: 3

{% translate_file pages/about.md %}

My problem is that jekyll-seo-tag doesn't read the value associated with the key pages.about.title in title tag, but display the key : <title>pages.about.title</title>.
How could I fix it ? Maybe in changing the order of jekyll-multiple-languages-plugin with a priority higher than this of jekyll-seo-tag ?

Hey @josephgarnier, I had the same issue and resolved it by doing this:

about.md:

---
title: listings.meta_title
description: listings.meta_description
keywords: listings.meta_keywords
layout: default
---

_i18n/en.yml:

global:
  lang: English
  meta_title: Site Title
  meta_description: This is the site description
  meta_keywords: these, are, your, site, keywords
about:
  meta_title: About
  meta_description: This is the About page description.
  meta_keywords: these, are, your, about, page, keywords

head.md:

{% assign global = site.translations[site.lang].global %}

{% assign title = site.translations[site.lang].global.meta_title %}
  {% if page.title %}
    {% capture page_title %}{% t page.title %} | {{ title }}{% endcapture %}
    {% assign title = page_title %}
  {% endif %}

{% assign description = site.translations[site.lang].global.meta_descritpion %}
  {% if page.description %}
    {% capture page_description %}{% t page.description %}{% endcapture %}
    {% assign description = page_description %}
  {% endif %}

{% assign keywords = site.translations[site.lang].global.meta_keywords %}
  {% if page.keywords %}
    {% capture page_keywords %}{% t page.keywords %}{% endcapture %}
    {% assign keywords = page_keywords %}
  {% endif %}

<head>
  <meta name="keywords" content="{{ keywords }}">
  <meta name="description" content="{{ description }}">
  <title>{{ title }}</title>
</head>

Just for information: jekyll/jekyll-seo-tag#373