Problem/Motivation

Currently the sitemap.xml contains a seperate entry for each node, because it doesn't recognize asymmetric translated nodes as translations of one another. The sitemap should contain translation sets instead.

Example:

  <url>
    <loc>https://example.com/nl/webpage</loc>
    <xhtml:link rel="alternate" hreflang="nl" href="https://example.com/nl/webpage"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/webpage"/>
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/webpage"/>
    <lastmod>2022-08-30T16:02:39+02:00</lastmod>
    <priority>0.5</priority>
  </url>

Steps to reproduce

  1. Create a node in one language
  2. Add an asymmetric translated node
  3. Check the sitemap to see if there is a translation set

Proposed resolution

Can we hook into sitemap generation? Not sure yet.

Remaining tasks

  1. Investigate ways to hook into sitemap generation
  2. Write a fix

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.x Comparechanges, plain diff MR !7

Comments

Paul Dudink created an issue. See original summary.

Trea made their first commit to this issue’s fork.

paul dudink’s picture

I haven't looked into it yet, by it looks like the Sitemap module provides a way to add custom Sitemap generators (see /nl/admin/config/search/simplesitemap/types).

paul dudink’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.