iachat/app/views/public/api/v1/portals
TheDanniCraft 885b041a83
fix: Update help center sitemap XML structure (#13357)
# Pull Request Template

## Description
The Help Center sitemap endpoint (`/hc/:portal_slug/sitemap.xml`)
previously rendered a `<sitemapindex>` element while embedding article
URLs directly, which does not align with the sitemap specification.

This change fixes the structure by:
- Replacing `<sitemapindex>` with `<urlset>`
- Adding the required sitemap XML namespace
- Rendering each published article as a `<url>` entry with `<loc>` and
`<lastmod>`

This ensures the endpoint outputs a valid, self-contained sitemap
document.

Fixes #13334

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?
- Updated the existing `portals_controller_spec.rb`
- Adjusted assertions to validate a `<urlset>` root element and the
sitemap XML namespace
- Verified that the sitemap returns only published article URLs
- Ran the updated RSpec controller specs locally


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules
2026-01-26 18:08:20 -08:00
..
articles feat: OG Image in Chatwoot Help Center (#11826) 2025-07-03 12:41:12 -07:00
categories feat: OG Image in Chatwoot Help Center (#11826) 2025-07-03 12:41:12 -07:00
error feat: Update public portal colors with new design (#8230) 2023-11-23 08:16:52 +05:30
_article_count.html.erb fix: Fix i18n issues with help center (#6559) 2023-02-27 17:45:57 -08:00
_authors.html.erb feat: Add RTL support in public help center (#11692) 2025-06-09 15:23:04 -04:00
_category-block.html.erb feat: Author sections in category block and category list (#8414) 2023-11-27 15:13:38 +05:30
_featured_articles.html.erb feat: Author sections in category block and category list (#8414) 2023-11-27 15:13:38 +05:30
_footer.html.erb feat: Add INSTALLATION_NAME to global config (#12376) 2025-09-09 12:13:35 +05:30
_header.html.erb chore: Display divider only when multiple portals are available (#11709) 2025-06-12 17:01:41 +05:30
_hero.html.erb feat: OG Image in Chatwoot Help Center (#11826) 2025-07-03 12:41:12 -07:00
_mobile_menu.html.erb chore: Display divider only when multiple portals are available (#11709) 2025-06-12 17:01:41 +05:30
_thumbnail.html.erb feat: Author sections in category block and category list (#8414) 2023-11-27 15:13:38 +05:30
_uncategorized-block.html.erb feat: Update public portal colors with new design (#8230) 2023-11-23 08:16:52 +05:30
index.json.jbuilder feat: Sort articles based on views (#7599) 2023-07-24 20:27:43 -07:00
show.html.erb fix: Include uncategorized articles in the all article section to allow edit/delete (#10153) 2024-09-23 23:39:03 -07:00
show.json.jbuilder feat: Sort articles based on views (#7599) 2023-07-24 20:27:43 -07:00
sitemap.xml.erb fix: Update help center sitemap XML structure (#13357) 2026-01-26 18:08:20 -08:00