kurtsson / jekyll-multiple-languages-plugin

I18n support for Jekyll and Octopress
MIT License
922 stars 203 forks source link

Different language on same posts #176

Open antwal opened 3 years ago

antwal commented 3 years ago

Hi,

I have a very similar problem of issue #115 that I just can't solve

Using a structure like the one proposed by @joshcummingsdesign it works perfectly the only problem is that if I want to show users if a certain post is present in another language I can't do it.

example posts:

---
layout: post
title:  "Bootstrap is The Most Popular Framework"
date:   2020-09-20 14:50:25 +0200
categories: bootstrap update
reference: A34G5D
lang: en
---

---
layout: post
title:  "Bootstrap es el marco más popular"
date:   2020-09-20 14:50:25 +0200
categories: bootstrap update
reference: A34G5D
lang: es
---

using the following code, specifying the same "reference" for multiple posts in multiple languages doesn't work, as site.posts only returns posts of the current language:

{% assign posts = site.posts | where: "reference", page.reference %}

Is there any way to fix this?

Thanks.