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

[Feature request]i18n support #88

Closed
Glennvd opened this issue Oct 21, 2015 · 8 comments
Closed

[Feature request]i18n support #88

Glennvd opened this issue Oct 21, 2015 · 8 comments

Comments

@Glennvd
Copy link

Glennvd commented Oct 21, 2015

Jekyll supports multilingual websites through a plugin (https://github.com/screeninteraction/jekyll-multiple-languages-plugin). It would be great to be able to include these in the sitemap as well.

@parkr
Copy link
Member

parkr commented Nov 24, 2015

Can you explain how you would like to include them in the sitemap? Perhaps the plugin could add them?

@parkr parkr added the question label Nov 24, 2015
@pathawks
Copy link
Member

I think the deal is that screeninteraction/jekyll-multiple-languages-plugin creates several different versions of the site: one for each language provided (generated in _site/en/ for example), plus the default language in the root position (generated _site/).

Because each language is built as a separate site, the sitemap.xml that is built in the root cannot know about each page built for each language specific version of the site.

I have no idea how this could be addressed for this specific plugin.

@pathawks
Copy link
Member

With the current design of screeninteraction/jekyll-multiple-languages-plugin, there is just no way this is possible 😞

@KMax
Copy link

KMax commented Apr 15, 2017

There're guidelines from Google about alternative language pages. I guess, the plugin could apply them to include links to alternative pages in the root sitemap.xml.

@Ryuno-Ki
Copy link

@pathawks Could you go more in detail about this?

With the current design of screeninteraction/jekyll-multiple-languages-plugin, there is just no way this is possible 😞

What is the main issue here? I would like to look into writing a PR to address this (because I am currently working on WeAreFairphone/landing-page which would benefit from this feature. I am wondering, on which site I would have to write a patch.

@pathawks
Copy link
Member

@Ryuno-Ki Just to elaborate a bit:

The way screeninteraction/jekyll-multiple-languages-plugin works is by generating the site multiple times, once for each language. This means that when (ie) the German version of a site is generating, Jekyll does not know anything about the English version of a site. When the English version of a site is generating, Jekyll does not know anything about the German version of the site. The way the plugin is implemented, there is no way for a plugin to even know that other language versions of the site exist!

In order for this sitemap plugin to work with that plugin, there would need to be only one generate performed on a site. That would require a complete redesign of how screeninteraction/jekyll-multiple-languages-plugin works; not just a few changes, but redesigning the foundational design. It impossible for jekyll-sitemap to work with the current design of screeninteraction/jekyll-multiple-languages-plugin.

I think, rather than trying to completely redesign that plugin, it would be easier to add a sitemap generator to screeninteraction/jekyll-multiple-languages-plugin.

@elnappo
Copy link

elnappo commented Apr 24, 2018

As a workaround I use sitemapindex as jekyll-sitemap generates a sitemap.xml for every language e.g. /sitemap.xml and /en/sitemap.xml

sitemap_index.xml:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://www.example.com/sitemap.xml</loc>
    </sitemap>
    <sitemap>
        <loc>https://www.example.com/en/sitemap.xml</loc>
    </sitemap>
</sitemapindex>

robots.txt:

User-agent: *
Sitemap: https://www.example.com/sitemap_index.xml

@pathawks
Copy link
Member

@elnappo This is an interesting idea I hadn’t considered! Thanks for sharing

@jekyll jekyll locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants