Changes for version 0.003 - 2026-10-26
- BREAKING: individual brands are configured with "brands", a hash from brand names to their directories, instead of "paths"; brand names no longer come from directory names. A brand can also have separate "templates" and "public" directories, and "ignore_app_paths" to stop falling back to the application.
- BREAKING: "stash_key" defaults to "branding.brand" instead of "variant". Brand and variant are now independent: application variants keep working for branded requests, brands can have their own variant templates, and templates/index.html+acme.ep is no longer used for brand "acme".
- BREAKING: when a brand is configured again in a later registration, its directories replace the earlier ones instead of being merged.
- BREAKING: a leading "/" in a template name only works with the default handler, as in plain Mojolicious.
- New "brand" helper to get or set the brand of the request.
- "global" accepts the same specification as a brand (existing configurations keep working); several "global" registrations stack, the last one winning.
- Branded public files are served by Mojolicious at the usual point of the request: hooks are honored whatever their registration order (including render_later), a static prefix set later is followed, and reply->static is branded too.
- Each brand has its own renderer and static file server: templates are branded in every rendering (any request method, layouts, partials, exception and not_found pages), e.g. a brand can override just the layout of the application's pages.
- Relative Mojo::File paths are resolved from the application home; a missing absolute directory is skipped instead of being looked up under the home; unknown configuration keys croak.
- A warning is logged at startup for a brand that ignores the application but has no directories of its own.
Modules
Global and per-request branding of templates and public files
Provides
in lib/Mojolicious/Plugin/Branding.pm
in lib/Mojolicious/Plugin/Branding.pm
in lib/Mojolicious/Plugin/Branding.pm