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: Add localization to the sitemap #39

Closed
alfonsobries opened this issue Jan 8, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@alfonsobries
Copy link

commented Jan 8, 2019

Currently it's not possible to add localization to a sitemap.xml accordingly to the google recommendations

https://support.google.com/webmasters/answer/189077

<url>
    <loc>http://www.example.com/english/page.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page.html"/>
  </url>
This question is available on Nuxt community (#c34)

@cmty cmty bot closed this Jan 8, 2019

@cmty cmty bot added the cmty:question label Jan 8, 2019

@cmty

This comment has been minimized.

Copy link

commented Jan 8, 2019

This issue as been imported as question since it does not respect sitemap-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/sitemap-module/issues/c34.

This comment has been minimized.

Copy link
Member

commented Feb 16, 2019 — with CMTY

You can easily add alternate language pages with the links attribute:

    routes() {
      return [{
        url: '/english/page.html',
        links: [
          { lang: 'de', url: '/deutsch/page.html' },
          { lang: 'de-ch', url: '/schweiz-deutsch/page.html' },
          { lang: 'en', url: '/english/page.html' }
        ]
      }]
    }

see doc:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.