PhoenixKit.Modules.Publishing.Web.Controller.SlugResolution (PhoenixKitPublishing v0.1.5)

Copy Markdown View Source

URL slug resolution for the publishing controller.

Handles resolving URL slugs to internal slugs, including:

  • Per-language custom URL slugs
  • Previous URL slugs for 301 redirects
  • DB-based slug lookups

Summary

Functions

Builds redirect URL for 301 redirects from cached post data.

Resolves URL slug to internal slug using cache/DB.

Resolves a URL slug to the internal post slug. Used by versioned URL handler and other places that need the internal slug.

Functions

build_post_redirect_url(group_slug, cached_post, language, url_slug)

Builds redirect URL for 301 redirects from cached post data.

resolve_url_slug(group_slug, arg2, language)

Resolves URL slug to internal slug using cache/DB.

Returns:

  • {:redirect, url} for 301 redirect to new URL
  • {:ok, identifier} for resolved internal slug
  • :passthrough for direct use

resolve_url_slug_to_internal(group_slug, url_slug, language)

Resolves a URL slug to the internal post slug. Used by versioned URL handler and other places that need the internal slug.