Closed nbusseneau closed 3 years ago
Great PR, I'm waiting for it..
From my initial testing, this does not preserve the existing default behavior. For example with no multilanguage enabled, it doesn't show all the pages. I cannot consider this for merging unless default behavior is maintained as it will break anyone's site that is not multilanguage enabled.
You are 100% right, my mistake for not testing behaviour with multilanguage disabled. I think I see where the issue is, I'll revisit this PR when I have some free time (probably next week).
@rhukster Should be fixed now. Logic was flawed as I hadn't taken into account that translatedLanguages()
would not work when multi-language was not enabled. The new logic first checks if multi-language is enabled so as to properly add either the entry as-is or all its available translations.
Will take a look at this next week. Thanks!
Bumping this -- don't hesitate to HMU if I can do anything.
I've tested this commit on November 6 here
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.
@01Kuzma Can you share a minimal website sample reproducing the issue? That way I'll have a better chance to successfully fix the code for more usages than just my own :)
@Skymirrh, here is what I'm getting:
As for example, once I access the default webpage: website.com/sitemap
I've got links to all resources with all languages shown. Firstly comes links with a default language:
http://website.com/about
http://website.com/cookies
and then links with a second language, BUT all slugs are the same:
http://website.com/ru/about
http://website.com/ru/cookies
When I access URL website.com/ru/sitemap
the slug's of a second language are changed to normal:
http://website.com/ru/o-nas
http://website.com/ru/politika
BUT the slugs of a default language are also taken from second language:
http://website.com/o-nas
http://website.com/politika
Currently I'm running Grav 1.7 RC20 and without commits plug-in is working correctly. Probably something was changed in the core...
And I observed a bug: website is running under SSL, but the links are displayed without https
What should I provide you? A skeleton of a website? I could remove unnecessary parts and zip it.
Yes, an archive with a minimal skeleton reproducing the issue is perfect.
I have only developed and tested on 1.6, not 1.7, so that is also something I'll have to consider.
@Skymirrh , this should work. I left only minimal required data.
Plug-in is not patched, so you could check before and after.
As archive is too big, I've temporary placed it here: ` Zip password:
`
Thanks, I'll have a look at it when I have some time next week.
OK, could I remove the archive from website?
I downloaded it just now, you can remove it if you want :)
I tried your PR branch, but it didn't produce the desired results I was looking for. Unfortunately, It didn't take into account page fallback nor did it produce all the hreflang crosslinks. I found it easier to just do things my own custom way: https://github.com/getgrav/grav-plugin-sitemap/commit/856aea099cf5b62ba566669c9a2bf9f66d6f35ea
Please test the 'develop' branch and if there's no major issues I'll release it as 3.0. Cheers!
Nice! I'll try it out this evening and report back.
Sorry for not testing last evening, had some other stuff pop up.
Tested just right now: it works fine on my end, I do get one entry for each translation of each page on my website, identically to my own implementation attempt 👍🏻
This fixes #59 by properly adding one entry for each translation of each page in sitemap, with all entries referencing all other translations of the same page.
As per https://support.google.com/webmasters/answer/189077: