PhoenixKit. Modules. Publishing. PublishingVersion
(PhoenixKitPublishing v0.6.0)
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 editedpublished- 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 stringsdescription- SEO meta descriptionallow_version_access- Whether older versions are publicly accessiblefeatured- Whether this post is featured (pinned to the top of the group listing and rendered larger). Per-group display is gated by the group's ownfeatured_enabled/featured_layoutconfig.
Version history
created_from- Source version number this was created fromnotes- Version notes/changelog
Summary
Functions
Changeset for creating or updating a publishing version.
Returns whether older versions are publicly accessible.
Returns the post's audio-version file uuid (nil when none).
Returns the categories filed against this version.
Returns the source version number this was created from.
Returns the SEO description.
Returns whether this post is featured (pinned + shown larger on the group listing).
Returns the featured image UUID.
Returns version notes.
Returns the post tags.
Types
@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 for creating or updating a publishing version.
Returns whether older versions are publicly accessible.
Returns the post's audio-version file uuid (nil when none).
A cleared audio picker submits "", and older rows still carry that
blank. Blank normalizes to nil HERE so every reader agrees: an empty
string is truthy in Elixir, so a template gating on the raw value
rendered a player whose src had an empty uuid segment
(/file//original/<token> — a dead request).
Returns the categories filed against this version.
Version-level, like everything else here. A post's subject can genuinely
change between versions — a release note that grows into a guide — and the
old version keeps the filing it was published under, which is what someone
reading ?v=2 should see. A new version inherits the whole data map from
the one it was created from, so this carries forward by default and only
differs where somebody changed it.
Returns the source version number this was created from.
Returns the SEO description.
Returns whether this post is featured (pinned + shown larger on the group listing).
Returns the featured image UUID.
Returns version notes.
Returns the post tags.