Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Plugin does not work with jekyll-multiple-languages-plugin #373

Open
rtaibah opened this issue Dec 9, 2019 · 7 comments · May be fixed by #393
Open

i18n: Plugin does not work with jekyll-multiple-languages-plugin #373

rtaibah opened this issue Dec 9, 2019 · 7 comments · May be fixed by #393

Comments

@rtaibah
Copy link

rtaibah commented Dec 9, 2019

Been knee deep with a i18n project, and this plugin does not work well with page title tags (maybe other elements too, haven't investigated.)

The jekyll-multiple-languages-plugin [1] works by changing the title frontmatter to refer to separate language files placed in i18n/language-name/posts/blog.md where the actual translated text lives. As such:

---
title: posts.blog.title
subtitle: posts.blog.subtitle
---

{% tf posts/blog.md %}

The end result is translated files, but bad seo, as titles are being outputted as a literal posts.blog.title.

Now I am willing to look into this plugin and figure out how to do it and then do a PR, but I am not the most well-versed in Ruby. Any pointers or help would be highly appreciated.


[1] Jekyll Multiple Languages Plugin

@jekyllbot jekyllbot added the stale label Feb 9, 2020
@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@jokeum
Copy link

jokeum commented Mar 28, 2020

+1
I for now use {% seo title=false %} with a custom <title>{% t page.title %}</title> instead, but the og:title is still there and outputting wrong tag.

@jekyllbot jekyllbot removed the stale label Mar 28, 2020
@trasher
Copy link

trasher commented May 19, 2020

👍

@jokeum Looking at the template file, og:title is conditionned on page_title not title ;) Note that one is also used for twitter:title meta tag.

@shushugah
Copy link

Hey I am a maintainer of jekyll-multiple-languages-plugin is there something I could to help?

@trasher
Copy link

trasher commented Jun 2, 2020

Hi @shushugah, thanks for your attention :)

As far as I've seen, seo-tag do use page.title property to construct its own page title that is then used in several places finally (title, meta/og:ittle json+ld, and maybe other).

Of course, when using multiple-languages plugin, page.title value is the slug for the translation; and it is used verbatim.
I've been (almost) able to get things working on my side, hacking the seo-tag provided template to provide my own title and meta/og:title values (see #393, https://github.com/galette/website/blob/develop/_includes/head.html#L9 and https://github.com/galette/website/blob/develop/seo-tag-galette-fix.patch). Not really elegant nor maintainable solution

Thinking about how to get that working, I see two possibilities:

  1. make seo-tag aware of translation plugin presence, and tell it to take the correct title from the very beginning - a kind of "if lang plugin present, ask it for title, otherwise take raw value" (this would work only for multiple-languages-plugin, but that sounds possible [if seo-tag maintainers are ok with that kind of stuff]),
  2. make page.title be translated before it is called/used from seo-tag; I do not even know if it is possible but that would be a possible global solution for all other langs plugins as well (while the first one would require a condition for every other possible plugin).

I'm not a jekyll nor ruby expert at all (I began to use jekyll less than 2 weeks ago), and I've unfortunately not been able to find how to implement any of those solutions (and maybe there is another, better solution I did not think about!).

Anyways, thanks to everyone involved in both plugins; I do had issues, but my project new website is up and running now :-)

@Jaibararia-wfd
Copy link

Hello Everyone, Just want to know that is this approach ( Compatibility with jekyll-seo-tag kurtsson/jekyll-multiple-languages-plugin#143) is working or not?
If not then is there any solution yet?

@ghost
Copy link

ghost commented May 26, 2021

I don't think so, but I am running into the same issue :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants