Centralized constants for the Publishing module.
Provides canonical lists for statuses, modes, and types used across schemas, business logic, and templates. Import or alias this module instead of hardcoding these values inline.
For guard clauses and pattern matches, use the module attributes:
@timestamp_modes Publishing.Constants.timestamp_modes()
@slug_modes Publishing.Constants.slug_modes()
def my_func(mode) when mode in @timestamp_modes do ...
Summary
Functions
Valid version and content statuses: draft, published, archived.
Default featured-post layout ("hero").
Default public-listing sort order ("newest" first).
Default group mode.
Default post-date position ("below" the title).
Default post-page content width ("normal").
Default scrollbar style ("default" — the browser's native bar, untouched).
Default date-timeline granularity ("auto").
Default title for posts without a title.
Default group type.
Valid featured-post layouts: "hero" (band above the grid) or "card" (larger card in the grid).
Valid group statuses: active, trashed.
Valid public-listing sort orders: "newest" or "oldest", by effective publish date.
Max length for group names.
Max length for group slugs.
Max length for language codes.
Max length for post/content slugs.
Max length for content titles.
Valid post-date positions relative to the title: "above", "below", or "hidden".
Valid post statuses: draft, published, archived, trashed.
Valid post-page content widths: "narrow", "normal", or "wide".
Preset group types (shown as radio buttons in UI).
Valid scrollbar styles: "default" (native, unstyled), "branded" (theme-colored), "thin" (theme-colored + thin).
Returns true if mode is a slug mode (atom or string).
Atom and string variants for slug mode — use in guards/pattern matches.
Valid date-timeline granularities: "auto" (fit to the posts' date span), "year", "month", or "day".
Returns true if mode is a timestamp mode (atom or string).
Atom and string variants for timestamp mode — use in guards/pattern matches.
Valid mode strings for schema validation.
All valid group types including custom.
Functions
Valid version and content statuses: draft, published, archived.
Default featured-post layout ("hero").
Default public-listing sort order ("newest" first).
Default group mode.
Default post-date position ("below" the title).
Default post-page content width ("normal").
Default scrollbar style ("default" — the browser's native bar, untouched).
Default date-timeline granularity ("auto").
Default title for posts without a title.
Default group type.
Valid featured-post layouts: "hero" (band above the grid) or "card" (larger card in the grid).
Valid group statuses: active, trashed.
Valid public-listing sort orders: "newest" or "oldest", by effective publish date.
Max length for group names.
Max length for group slugs.
Max length for language codes.
Max length for post/content slugs.
Max length for content titles.
Valid post-date positions relative to the title: "above", "below", or "hidden".
Valid post statuses: draft, published, archived, trashed.
Valid post-page content widths: "narrow", "normal", or "wide".
Preset group types (shown as radio buttons in UI).
Valid scrollbar styles: "default" (native, unstyled), "branded" (theme-colored), "thin" (theme-colored + thin).
Returns true if mode is a slug mode (atom or string).
Atom and string variants for slug mode — use in guards/pattern matches.
Valid date-timeline granularities: "auto" (fit to the posts' date span), "year", "month", or "day".
Returns true if mode is a timestamp mode (atom or string).
Atom and string variants for timestamp mode — use in guards/pattern matches.
Valid mode strings for schema validation.
All valid group types including custom.