getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Wrong URL used in xhtml:link rel="alternate" #69

Closed lazybadger closed 3 years ago

lazybadger commented 4 years ago

In case of page with added page-specific "default route" original address used in xhtml:link instead of correct route

    <loc>site/special/collection</loc>
    <xhtml:link rel="alternate" hreflang="ru" href="site/tech" />

Definition in <loc> is good and correct, in <xhtml:link> - no (/tech must be /special/collection always)

rhukster commented 4 years ago

This seems to be specific to multilang/translated pages?

lazybadger commented 4 years ago

This seems to be specific to multilang/translated pages?

To any language-specific (for me): I have (for now) single-language non-English sites and define language for all pages with my (non-default) content, i.e. they have <tpl>.ru.md filename. Why current (original) href in alternate is bad for SEO: It have to be hidden, technical location - visible accessible for users URL defined and used in site-navigation is routed URL Search-engines crawlers on parsing sitemap (which is faster and more frequent process, than crawling on links on frontend and external backlinks) will

  1. add to SE-index wrong URL (from xhtml:link)

  2. later, when the same page will be added into index with frontend-URL (from default route) these pages with identical content will be qualified as doubles () and most probably front-url will be excluded from the index, as "indexed later" (which is unwanted result)

rhukster commented 3 years ago

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