Merged
Conversation
Pass `context={"sitemap": None}` to app.add_page to exclude the page from the
generated sitemap.
Contributor
Greptile SummaryAdded opt-out functionality for sitemap generation by allowing pages to pass
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant App as Reflex App
participant Plugin as SitemapPlugin
participant Gen as generate_links_for_sitemap
participant Config as configuration_with_loc
participant XML as generate_xml
App->>Plugin: pre_compile(unevaluated_pages)
Plugin->>Gen: sitemap_task(unevaluated_pages)
loop For each page
Gen->>Gen: page.context.get("sitemap", {})
alt sitemap is None
Gen->>Gen: skip page (opt-out)
else sitemap exists
alt is dynamic/404 route
alt no config or no loc
Gen->>Gen: skip page or warn
else has loc
Gen->>Config: configuration_with_loc(config, deploy_url, loc)
Config-->>Gen: SitemapLink
end
else static route
alt has custom loc
Gen->>Config: configuration_with_loc(config, deploy_url, loc)
Config-->>Gen: SitemapLink
else use default route
Gen->>Config: configuration_with_loc(config, deploy_url, route)
Config-->>Gen: SitemapLink
end
end
end
end
Gen-->>Plugin: list[SitemapLink]
Plugin->>XML: generate_xml(links)
XML-->>Plugin: XML string
Plugin->>App: save to public/sitemap.xml
|
adhami3310
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass
context={"sitemap": None}to app.add_page to exclude the page from the generated sitemap.