PhoenixKit.Modules.Publishing.PublishingVersion (PhoenixKitPublishing v0.1.5)

Copy Markdown View Source

Schema for publishing post versions.

Versions are the source of truth for published state and metadata. Each post can have multiple versions (v1, v2, etc.). Each version contains per-language content rows in PublishingContent.

Status Flow

  • draft - Version is being edited
  • published - Version is live (post.active_version_uuid points here)
  • archived - Version replaced by newer one

Data JSONB Keys

Version metadata (defaults for all languages)

  • featured_image_uuid - Featured image reference (media UUID)
  • tags - List of tag strings
  • seo - SEO metadata map (og_title, og_description, og_image, etc.)
  • description - SEO meta description
  • allow_version_access - Whether older versions are publicly accessible

Version history

  • created_from - Source version number this was created from
  • notes - Version notes/changelog

Summary

Functions

Changeset for creating or updating a publishing version.

Returns whether older versions are publicly accessible.

Returns the source version number this was created from.

Returns the SEO description.

Returns the featured image UUID.

Returns version notes.

Returns SEO metadata.

Returns the post tags.

Types

t()

@type t() :: %PhoenixKit.Modules.Publishing.PublishingVersion{
  __meta__: term(),
  contents: term(),
  created_by: term(),
  created_by_uuid: UUIDv7.t() | nil,
  data: map(),
  inserted_at: DateTime.t() | nil,
  post: term(),
  post_uuid: UUIDv7.t(),
  published_at: DateTime.t() | nil,
  status: String.t(),
  updated_at: DateTime.t() | nil,
  uuid: UUIDv7.t() | nil,
  version_number: integer()
}

Functions

changeset(version, attrs)

Changeset for creating or updating a publishing version.

get_allow_version_access(publishing_version)

Returns whether older versions are publicly accessible.

get_created_from(publishing_version)

Returns the source version number this was created from.

get_description(publishing_version)

Returns the SEO description.

get_notes(publishing_version)

Returns version notes.

get_seo(publishing_version)

Returns SEO metadata.

get_tags(publishing_version)

Returns the post tags.