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

Dynamicly variable dynamic sitemaps #267

Open
ibrahimBeladi opened this issue Sep 14, 2022 · 0 comments
Open

Dynamicly variable dynamic sitemaps #267

ibrahimBeladi opened this issue Sep 14, 2022 · 0 comments

Comments

@ibrahimBeladi
Copy link

I am trying to generate various sitemaps based on various api end points.
Let's assume having 2 end points, one for users and the other for events. Each with 2000+ record.
I want to generate sitemaps where each is having upto 1000 records, and in the end, include these dynamically dynamic sitemaps, with another statically made sitemap (let call it public.xml) and include them all in the main sitemap (let's call it sitemap.xml)

public.xml would be like

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"
    xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
    <url>
        <loc>DOMAIN</loc>
    </url>
    ....
    <url>
        <loc>DOMAIN/about</loc>
    </url>
</urlset>

sitemap.xml would be like:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>DOMAIN/sitemaps/users.xml</loc>
    </sitemap>
    <sitemap>
        <loc>DOMAIN/sitemaps/users_2.xml</loc>
    </sitemap>
    ....
    <sitemap>
        <loc>DOMAIN/sitemaps/events.xml</loc>
    </sitemap>
    <sitemap>
        <loc>DOMAIN/sitemaps/events_2.xml</loc>
    </sitemap>
    ....
    <sitemap>
        <loc>DOMAIN/sitemaps/public.xml</loc>
    </sitemap>
</sitemapindex>

I tried various combinations, but nothing seems to work 100% deterministically, one time it works, another time it fails. It takes long time to test this out as I need to test it with more than one model with each having more than one page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant