PhoenixKitOG.Routes (PhoenixKitOG v0.1.0)

Copy Markdown View Source

Route registration for routes that can't be inlined on a Tab — notably the per-template editor at /admin/open-graph/:uuid/edit.

The two index routes (/admin/open-graph and …/assignments) are still registered via the live_view: field on their admin tabs in PhoenixKitOG.admin_tabs/0; including them here as well would produce a duplicate-route error.

Summary

Functions

Localized admin routes — /<locale>/admin/.... The editor + new-template routes only; index pages come from the live_view: field on tabs.

Non-localized variants.

Public (non-admin) routes injected into the host router. We mount a single endpoint that serves cached OG PNGs.

Functions

admin_locale_routes()

Localized admin routes — /<locale>/admin/.... The editor + new-template routes only; index pages come from the live_view: field on tabs.

admin_routes()

Non-localized variants.

generate(url_prefix)

Public (non-admin) routes injected into the host router. We mount a single endpoint that serves cached OG PNGs.

No auth — OG image consumers (Facebook, Twitter, LinkedIn) don't carry sessions. The route lives under the host's PhoenixKit URL prefix and rides the standard :browser pipeline so it inherits session/CSRF handling for free, even though we don't use them.