PhoenixKit. Modules. Publishing. Web. Controller. SlugResolution
(PhoenixKitPublishing v0.2.0)
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 a 301 redirect URL from a resolved post map.
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
Builds a 301 redirect URL from a resolved post map.
Accepts both the cache-shaped map (carries :mode/:date/:time/:language_slugs)
and the DB-shaped map from db_content_to_post_map/1 (only :slug/:url_slug/
:language/:metadata), reading the cache-only fields defensively.
Resolves URL slug to internal slug using cache/DB.
Returns:
{:redirect, url}for 301 redirect to new URL{:ok, identifier}for resolved internal slug:passthroughfor direct use
Resolves a URL slug to the internal post slug. Used by versioned URL handler and other places that need the internal slug.