PhoenixKit.Modules.Publishing.PublishingPost (phoenix_kit v1.7.71)

Copy Markdown View Source

Schema for publishing posts within a group.

Each post belongs to a group and has versions with per-language content. Supports both slug-mode and timestamp-mode URL structures.

Status Flow

  • draft - Not visible to public
  • published - Live and visible
  • archived - Hidden but preserved
  • scheduled - Auto-publish at scheduled_at

Data JSONB Keys

  • allow_version_access - Whether older versions are publicly accessible
  • featured_image - Featured image reference (file UUID or URL)
  • tags - List of tag strings
  • seo - SEO metadata map (og_title, og_description, og_image, etc.)

Summary

Functions

Returns whether older versions are publicly accessible.

Changeset for creating or updating a publishing post.

Check if post is a draft.

Returns the featured image reference.

Returns SEO metadata.

Returns the post tags.

Check if post is published.

Check if post is scheduled for future publishing.

Types

t()

@type t() :: %PhoenixKit.Modules.Publishing.PublishingPost{
  __meta__: term(),
  created_by: term(),
  created_by_uuid: UUIDv7.t() | nil,
  data: map(),
  group: term(),
  group_uuid: UUIDv7.t(),
  inserted_at: DateTime.t() | nil,
  mode: String.t(),
  post_date: Date.t() | nil,
  post_time: Time.t() | nil,
  primary_language: String.t(),
  published_at: DateTime.t() | nil,
  scheduled_at: DateTime.t() | nil,
  slug: String.t(),
  status: String.t(),
  updated_at: DateTime.t() | nil,
  updated_by: term(),
  updated_by_uuid: UUIDv7.t() | nil,
  uuid: UUIDv7.t() | nil,
  versions: term()
}

Functions

allow_version_access?(publishing_post)

Returns whether older versions are publicly accessible.

changeset(post, attrs)

Changeset for creating or updating a publishing post.

draft?(arg1)

Check if post is a draft.

get_seo(publishing_post)

Returns SEO metadata.

get_tags(publishing_post)

Returns the post tags.

published?(arg1)

Check if post is published.

scheduled?(arg1)

Check if post is scheduled for future publishing.