getgrav / grav-plugin-sitemap

Grav Sitemap Plugin

Home Page:https://getgrav.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No multi-language support?

Crolug opened this issue · comments

Did I do something wrong or the plugin doesn't recognize additional languages?

@Crolug can you provide more info on how to replicate your problem? Works for me

Hi, @flaviocopes . Same problem, example: http://sqlserver-kit.org/sitemap
Latest version of plugin: 1.9.1

Same problem here, multi-language is not supported.

http://wplang.org/sitemaps-multiple-languages-wordpress/

Yes, thank you @jimblue , this article sums it up nicely how the multi-language sitemap should look like. That's what I meant - this plugin doesn't work that way afaik.

No one interested in trying to create a pull request to implement the multi-language sitemap format?

Sorry @rhukster I have no idea how to do that 😞 I'm not really a dev

@rhukster, I'm trying to understand the code... maybe it just miss something like foreach language before this?

foreach ($routes as $route => $path) {

This does require some thinking and a better solution. I've not got time to look into it now, but if someone can help, that would be appreciated.

Any update about this?

There luckily already is multilanguage support (since April 2017, version 1.9.1).

What crawlers see is sitemap.xml:
sitemap-xml
Note how for each link, their counterparts in other languages are provided.

What we see when opening /sitemap in browser is styled by sitemap.xsl, where some parameters are hidden:
sitemap-xsl

So all information needed for efficient multilanguage sitemap is already there for Google and other crawlers to see, but is hidden when viewing with styles in browser.

If styling in sitemap.xsl should be changed so that it is more apparent that multilanguage support is implemented is another question. It might make sense to avoid confusions like these?

I agree that the styling should be changed or removed rather. What's missing in the implementation of the hreflang though is an x-default and the route of the URL instead of the raw route if someone uses a translated alias for the URL. I just started using Grav and am absolutely not sure how to do this, but I'll try digging into this.

Okay, so apparently there's no clean way of doing this (or I have yet to find it).
What I do now is to CURL through the raw route URLs and use the redirects final destination for the sitemap. This is obviously very bad, but I prefer a clean sitemap to clean code... Could anyone give me a hint on how to cache the sitemap properly?

No any updates?

The current PR #83 is pretty beefy and needs to be thoroughly tested before we will able to merge and release a new version. I suggest checking out this PR and testing it for yourself and letting us know how it works.

I've downloaded two files from PR #83 and replaced originals and the result is negative. Tested on Grav 1.7 RC17
Now a URL http://localhost/project/LANG_CODE/sitemap
loads and shows some data (before it there was no any links), but rendered links are without the language code inside. They are pointing to the same default's language data.

Multilang support has been rewritten and significantly improved. Please try v3.0