PhoenixKitPublishing.Routes (PhoenixKitPublishing v0.1.12)

Copy Markdown View Source

Publishing module routes.

Provides route definitions for content management (publishing groups and posts).

Summary

Functions

Returns quoted admin LiveView route declarations for the shared admin live_session (localized).

Returns quoted admin LiveView route declarations for the shared admin live_session (non-localized).

Returns quoted code for publishing non-LiveView routes via generate/1. No-op — public routes are provided via public_routes/1 instead, which is placed later in the route order to avoid catch-all conflicts.

Returns an empty AST.

Functions

admin_locale_routes()

@spec admin_locale_routes() :: Macro.t()

Returns quoted admin LiveView route declarations for the shared admin live_session (localized).

admin_routes()

@spec admin_routes() :: Macro.t()

Returns quoted admin LiveView route declarations for the shared admin live_session (non-localized).

generate(url_prefix)

Returns quoted code for publishing non-LiveView routes via generate/1. No-op — public routes are provided via public_routes/1 instead, which is placed later in the route order to avoid catch-all conflicts.

public_routes(url_prefix)

@spec public_routes(String.t()) :: Macro.t()

Returns an empty AST.

Publishing's public catch-all is no longer registered through this hook. Dispatch happens via PhoenixKitPublishing.RouterDispatch — the host router's call/2 is overridden (by phoenix_kit_routes/0) to detect publishing-bound URLs and rewrite them onto an internal prefix where the catch-all lives. See PhoenixKitPublishing.RouterDispatch moduledoc

  • AGENTS.md "Public dispatch — RouterDispatch" for the full mechanism.

This callback is kept (returning a no-op) for backwards compatibility with PhoenixKitWeb.Integration.compile_external_public_routes/1, which walks every route_module looking for the function. Removing the callback entirely would require a coordinated bump of the function_exported?/3 guard in core.