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 not correctly generated for production site #1053

Closed
StevenMaude opened this issue Dec 8, 2022 · 0 comments · Fixed by #1054
Closed

sitemap.xml not correctly generated for production site #1053

StevenMaude opened this issue Dec 8, 2022 · 0 comments · Fixed by #1054
Labels
bug Something isn't working

Comments

@StevenMaude
Copy link
Contributor

StevenMaude commented Dec 8, 2022

Locally, it works:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
         <loc>http://127.0.0.1:8000/</loc>
         <lastmod>2022-12-08</lastmod>
         <changefreq>daily</changefreq>
    </url>
    <url>
         <loc>http://127.0.0.1:8000/access-policies/</loc>
         <lastmod>2022-12-08</lastmod>
         <changefreq>daily</changefreq>
    </url>
…

But on the production site,

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
         <loc>None</loc>
         <lastmod>2022-12-08</lastmod>
         <changefreq>daily</changefreq>
    </url>
    <url>
         <loc>None</loc>
         <lastmod>2022-12-08</lastmod>
         <changefreq>daily</changefreq>
    </url>
…

The fix is to specify site_url: https://docs.opensafely.org in mkdocs.yml.

However, I'm not sure we want this setting globally: strictly speaking, for local development and temporary Cloudflare PR, the site URL is different.

It is possible to make this switchable depending on deployment context, as I previously mentioned; I hadn't realised that this issue broke the sitemap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant