jekyll-seo-tag
jekyll-seo-tag copied to clipboard
i18n: Plugin does not work with jekyll-multiple-languages-plugin
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.
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.
+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.
:+1:
@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.
Hey I am a maintainer of jekyll-multiple-languages-plugin
is there something I could to help?
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:
- 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]),
- 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 :-)
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?
I don't think so, but I am running into the same issue :(