PhoenixKit.Modules.Sitemap.Sources.Posts (phoenix_kit v1.7.38)

Copy Markdown View Source

Posts source for sitemap generation.

Collects public posts from the PhoenixKit Posts system. Automatically detects if public routes exist for posts.

URL Structure

  • Posts index: /posts (or with language prefix for non-default: /et/posts)
  • Individual posts: /posts/:slug (or /et/posts/:slug)

Enabling

This source is enabled when:

  1. Posts module is enabled (posts_enabled setting)
  2. Public routes exist for posts in the parent router
  3. Routes do NOT require authentication (checked via on_mount hooks)

Routes with the following on_mount hooks are considered private and excluded:

  • :phoenix_kit_ensure_authenticated_scope - requires logged-in user
  • :phoenix_kit_ensure_admin - requires admin access
  • :ensure_authenticated - generic authentication requirement
  • :require_authenticated_user - requires authenticated user

Exclusion

Posts can be excluded by setting post.metadata["sitemap_exclude"] = true.

Sitemap Properties

  • Posts index:

    • Priority: 0.7
    • Change frequency: daily
    • Category: "Posts"
  • Individual posts:

    • Priority: 0.8
    • Change frequency: weekly
    • Category: "Posts"
    • Last modified: Post's updated_at or published_at