Send sitemap.xml as a file rather than as content

Created on 9 April 2023, over 1 year ago
Updated 28 February 2024, 9 months ago

Problem/Motivation

Currently, sitemap.xml is sent as a content route, not a file which means the XSL stylesheet isn't applied in the browser.

Steps to reproduce

  • Install Drupal 9
  • Enable and configure quant, quant_api, quant_sitemap and xmlsitemap modules
  • Use devel_generate to generate content
  • Generate the sitemap.xml file and check it's working
  • Go to Seed tab (/admin/config/services/quant/seed)
  • Check Export sitemaps and Trigger the batch
  • Click Save configuration button
  • Result: Look at Quant Dashboard and see sitemap.xml in content list
  • Expected result: Sitemaps should be in file list
  • Proposed resolution

    Fix sitemap seeding.

    Remaining tasks

    1. Debug
    2. Update code
    3. Review and test
    4. Commit :)

    User interface changes

    API changes

    Data model changes

    πŸ› Bug report
    Status

    Postponed

    Version

    1.0

    Component

    Code

    Created by

    πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    Live updates comments and jobs are added and updated live.
    Sign in to follow issues

    Comments & Activities

    • Issue created by @Kristen Pol
    • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

      Moving to minor.

    • Status changed to Closed: works as designed 10 months ago
    • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

      Debugged this one and it doesn't make sense anymore. The sitemap.xml file is not a physical file, at least for simple_sitemap. It used to be sitemap files were added to the file system and we could do this but now they are created as routes so we should keep them as routes. Closing.

    • Status changed to Active 10 months ago
    • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

      Reopening this. The XML file isn't rendering properly in the browser with the XSL because it's content type is:

      text/html; charset=UTF-8
      

      instead of:

      application/xml; charset=utf-8
      
    • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

      Update summary.

    • Status changed to Postponed 9 months ago
    • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

      Had a hard time figuring out how to do this one, so marking postponed for now. We probably have to write the file ourselves and then send the file over.

    Production build 0.71.5 2024