PhoenixKit.Modules.Publishing.PublishingContent (PhoenixKitPublishing v0.2.3)

Copy Markdown View Source

Schema for publishing content — one row per language per version.

Stores one content entry per language per version. Each content row has its own title, content body, status, and optional URL slug.

Data JSONB Keys

  • description - SEO meta description
  • previous_url_slugs - List of previous URL slugs for 301 redirects
  • featured_image_uuid - Per-language featured image override
  • seo_title - Custom SEO title (if different from title)
  • excerpt - Custom excerpt (if different from auto-generated)
  • custom_css - Per-language custom CSS
  • updated_by_uuid - UUID of last editor for this language
  • og - Per-language OpenGraph overrides (%{"title" => ..., "description" => ..., "image_uuid" => ...}). Any subset of keys; an absent/blank field falls back to the derived default. Stored as one namespaced map so a future OG module can read/migrate it wholesale.

Summary

Functions

Changeset for creating or updating publishing content.

Returns the SEO description.

Returns the custom excerpt.

Returns the per-language featured image UUID.

Returns the per-language OpenGraph override map, or nil when none is set.

Returns previous URL slugs for 301 redirects.

Returns the custom SEO title.

Returns the UUID of the last editor for this language.

Types

t()

@type t() :: %PhoenixKit.Modules.Publishing.PublishingContent{
  __meta__: term(),
  content: String.t() | nil,
  data: map(),
  inserted_at: DateTime.t() | nil,
  language: String.t(),
  status: String.t(),
  title: String.t(),
  updated_at: DateTime.t() | nil,
  url_slug: String.t() | nil,
  uuid: UUIDv7.t() | nil,
  version: term(),
  version_uuid: UUIDv7.t()
}

Functions

changeset(content, attrs)

Changeset for creating or updating publishing content.

get_description(publishing_content)

Returns the SEO description.

get_excerpt(publishing_content)

Returns the custom excerpt.

get_og(publishing_content)

Returns the per-language OpenGraph override map, or nil when none is set.

Shape: %{"title" => ..., "description" => ..., "image_uuid" => ...} — any subset of keys may be present. Callers fall back to derived defaults per field.

get_previous_url_slugs(publishing_content)

Returns previous URL slugs for 301 redirects.

get_seo_title(publishing_content)

Returns the custom SEO title.

get_updated_by_uuid(publishing_content)

Returns the UUID of the last editor for this language.