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

Sitemap.xml returns unpublished item paths #1742

Open
thaitranet opened this issue Feb 19, 2024 · 2 comments
Open

Sitemap.xml returns unpublished item paths #1742

thaitranet opened this issue Feb 19, 2024 · 2 comments
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug

Comments

@thaitranet
Copy link

thaitranet commented Feb 19, 2024

Describe the Bug

Sitemap.xml returns unpublished item paths from the same BLOB generated on the CM host and published to the Edge.
https://github.com/Sitecore/jss/blob/dev/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/pages/api/sitemap.ts

To Reproduce

  1. Add a new item in XMC but don't publish it.
  2. Go to https://rendering-host/sitemap.xml to see the item path. It returns 404 when the path is entered.
  3. Go to https://edge.sitecorecloud.io/.../media/Project/Sites/.../Sitemaps/.../sitemap.xml to see the same content.

Expected Behavior

The public sitemap.xml should show published URLs only.

Possible Fix

  1. Replace sitemap.ts to get routes from Edge GraphQL (without SXA)
  2. OR, generate a new sitemap BLOB for published URLs for the Edge and use SXA settings.

Provide environment information

  • Sitecore Version: XMC
  • JSS Version: 21.6.2
  • Browser Name and version: All
  • Operating System and version (desktop or mobile):
  • Link to your project (if available):
@addy-pathania
Copy link
Contributor

@thaitranet Thanks for registering this. I have added this to our backlog. We will be investing soon.

@art-alexeyenko art-alexeyenko added the backlog Issue/PR/discussion is reviewed and added to backlog for the further work label Mar 8, 2024
@alan-null
Copy link
Collaborator

Hey @thaitranet
Could you please confirm if the new item created had any workflow assigned?
If not, this is how it works right now by design.

To protect against it, every page MUST have a workflow assigned.

Currently sitemap.xml content has to be created on XM where there is NO information whether something was published or not (like it used to be possible with master & web architecture), thus workflow should be there to control it.

When there is a publish which triggers sitemap refresh all of the pages for a given site are used for sitemap regeneration.

re: Possible Fix

These are good ideas but none is prefect and some of the current functionalities couldn't work or would require extra changes in edge schema.

There are plans to improve current architecture but for now recommendation is to use workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug
Projects
None yet
Development

No branches or pull requests

4 participants