Entities source for sitemap generation.
Collects published entity records from the PhoenixKit Entities system. Each entity can define its own URL pattern in settings, and individual records can be excluded via metadata.
Universal Entity Support
This source automatically collects ALL published entities regardless of their name.
By default, auto-pattern generation is enabled (sitemap_entities_auto_pattern: true),
which means every entity with published records will be included in the sitemap.
URL Pattern Resolution
URL patterns are resolved using fallback chain:
- Entity-specific override:
entity.settings["sitemap_url_pattern"] - Router Introspection: automatic detection from parent app router
- Per-entity Settings:
sitemap_entity_{name}_pattern - Global Settings:
sitemap_entities_pattern - Auto-generated fallback:
/:entity_name/:slug(ifsitemap_entities_auto_patternis true)
Pattern variables:
:slug- Record slug:id- Record ID:entity_name- Entity name (for global pattern)
Examples
# Entity settings override (highest priority):
# entity.settings = %{"sitemap_url_pattern" => "/blog/:slug"}
# Generates: /blog/my-article
# Router auto-detection (if parent app has route):
# live "/pages/:slug", PagesLive, :show
# Entity "page" generates: /pages/my-article
# Settings override:
# sitemap_entity_page_pattern = "/content/:slug"
# Entity "page" generates: /content/my-article
# Auto-generated fallback (enabled by default):
# Entity "hydraulic_cylinder" generates: /hydraulic_cylinder/my-product
# Entity "contact_request" generates: /contact_request/request-123Index Pages
By default, index/list pages are included for each entity (e.g., /page, /products).
This can be controlled via the sitemap_entities_include_index setting (default: true).
Index path resolution:
- Entity settings:
entity.settings["sitemap_index_path"] - Router Introspection: automatic detection (e.g.,
/pageor/pages) - Per-entity Settings:
sitemap_entity_{name}_index_path - Auto-generated fallback:
/:entity_name(ifsitemap_entities_auto_patternis true)
Configuration
sitemap_entities_auto_pattern- Enable auto URL pattern generation (default: false)sitemap_entities_include_index- Include entity index pages (default: true)sitemap_entity_{name}_pattern- Per-entity URL pattern overridesitemap_entity_{name}_index_path- Per-entity index page path overridesitemap_entities_pattern- Global pattern template (e.g., "/:entity_name/:slug")
Exclusion
Records can be excluded by setting record.metadata["sitemap_exclude"] = true.
Sitemap Properties
Records:
- Priority: 0.8 (high priority for entity content)
- Change frequency: weekly
- Category: Entity display name
- Last modified: Record's date_updated timestamp
Index pages:
- Priority: 0.7
- Change frequency: daily
- Category: Entity display name
- Last modified: Entity's updated_at timestamp
Summary
Functions
Returns per-entity-type sub-sitemaps. Each entity type gets its own sitemap file.