Skip to content

Return a valid development courses sitemap #159

Description

@alexeygrigorev

Evidence

A read-only audit of https://web.dtcdev.click at current main checked the sitemap index and each child path on the development host.

  • /sitemap.xml returns 200 and lists the ten canonical production locations required by the existing sitemap contract.
  • Nine development child paths return 200 XML: main, blog, podcast, books, people, events, wiki, docs, and faq.
  • /sitemaps/courses.xml returns 500 text/html with X-Robots-Tag: noindex, nofollow instead of a valid XML sitemap.

The original audit incorrectly treated the production-origin <loc> values in the index as development request hosts; those canonical production URLs are intentional and remain unchanged. This issue is corrected to the reproducible development-host defect.

Scope

Make /sitemaps/courses.xml return a valid XML <urlset> on development for the current deployed database state, including the empty/no-course state, while preserving canonical production <loc> values, no-slash route policy, and production behavior. Reuse the existing _section_records("courses") and sitemap contract where possible; diagnose and fix the actual failure rather than adding fabricated course rows or weakening error handling.

Own only the smallest sitemap generation/routing code and focused tests needed for the courses section. Preserve the other nine sections and the index contract.

Non-goals

  • No content import or course data population.
  • No change to robots/indexing policy, canonical origin, DNS/AWS/CDN state, or production sitemap submission.
  • No migration/model behavior or unrelated route/SEO redesign.

Acceptance criteria

  • Development /sitemaps/courses.xml returns 200 application/xml for an empty database and for a database containing visible/hidden courses.
  • The response is well-formed XML, contains only canonical production no-slash URLs, and does not expose private course/registration data.
  • Development index and all other child sitemap routes remain unchanged and valid; X-Robots-Tag: noindex, nofollow remains present in development.
  • Focused Django/contract tests reproduce the empty and populated cases and reject a 500/HTML response.
  • uv/Make quality and applicable browser/SEO gates pass. This is an XML response-only fix; screenshots are not applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must-have or release-blockingbugSomething isn't workingseoArea: seotestingArea: testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions