Skip to content

feat: support named sitemap outputs#10

Merged
fidalgo merged 2 commits into
mainfrom
add-named-output
May 1, 2026
Merged

feat: support named sitemap outputs#10
fidalgo merged 2 commits into
mainfrom
add-named-output

Conversation

@fidalgo
Copy link
Copy Markdown
Contributor

@fidalgo fidalgo commented May 1, 2026

How to test

Release notes

Does this change need an explicit changelog or release-note callout beyond the PR title?

Checklist

  • PR title is a Conventional Commit and suitable for squash merge
  • Tests added/updated (if applicable)
  • Docs updated (if applicable)
  • I kept changes focused and easy to review
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.

fidalgo added 2 commits May 1, 2026 17:04
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.
@fidalgo fidalgo merged commit a6ff86b into main May 1, 2026
4 checks passed
@fidalgo fidalgo deleted the add-named-output branch May 1, 2026 14:43
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

Successfully merging this pull request may close these issues.

1 participant