feat: support named sitemap outputs#10
Merged
Merged
Conversation
Add optional named outputs so applications can generate separate sitemap artifacts from the same Indexmap configuration. This keeps the simple default flow unchanged while allowing slower or database-backed sitemap sections to be generated independently. Add artifact rendering and a file-backed store so generated sitemap XML can be uploaded or fetched through a small storage interface instead of always being written directly as static public files. This supports controller-served sitemaps, shared storage, and future object-storage integrations without requiring framework-specific middleware in the gem. The new API adds: - Indexmap.render(output_name) - Indexmap.create(output_name) - Indexmap.fetch(filename) - Indexmap.fetch!(filename) - config.output(:name) - config.store - config.after_create Named outputs inherit the default base URL, format, public path, and store unless overridden. Single-file named outputs can write one artifact such as `sitemap-insights-data.xml` without overwriting the main `sitemap.xml` index. Update the README with examples for: - the existing simple Rails configuration - named outputs for independently generated sections - controller-served sitemap artifacts - custom object-storage stores - deferred dynamic sitemap refresh jobs
Add named sitemap outputs while keeping Indexmap focused on local filesystem generation. A named output can override entries, sections, format, index filename, or public path, and otherwise inherits the main configuration. Make sitemap creation safer by generating files in a temporary directory, formatting and validating them there, and only replacing final sitemap XML files after validation succeeds. Existing sitemap files remain untouched when generation or validation fails. Run `after_create` callbacks only after the validated files have been published. Remove the artifact/store abstraction and related object-storage examples so the gem stays framework-agnostic. Applications can still upload generated files to their own storage layer after Indexmap has produced a validated local sitemap set. Also harden gem packaging so deleted tracked files are ignored when building from a dirty release-preparation worktree.
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.
How to test
Release notes
Does this change need an explicit changelog or release-note callout beyond the PR title?
Checklist
About the maintainers
Built by Ethos Link, the team behind Reviato.
Capture. Interpret. Act.
Turn guest feedback into clear next steps for your team. Collect private appraisals, spot patterns across reviews, and act before small issues turn into public ones.