blog
konigle.models.website.blog
¶
Blog models for the Konigle SDK.
This module provides models for blog posts including creation, update, and resource representations.
BaseBlog
¶
Bases: BaseModel
Base class for blog models with common editable fields.
Contains fields that can be set during creation/update. Excludes publication status which is managed through separate API calls.
author = Field(default=None, title='Author', description='Primary author of the blog post')
class-attribute
instance-attribute
¶
Primary author of the blog post.
content = Field(default=None, title='Content', description='Rich text blocks for the blog post in EditorJS format')
class-attribute
instance-attribute
¶
Rich text blocks for the blog post in EditorJS format.
contributor_ids = Field(default_factory=list, title='Contributor IDs', description='List of contributor IDs for the blog post')
class-attribute
instance-attribute
¶
List of contributor IDs for the blog post.
exclude_from_sitemap = Field(default=False, title='Exclude From Sitemap', description='Whether the blog post is excluded from sitemap')
class-attribute
instance-attribute
¶
Whether the blog post is excluded from sitemap.
folder = Field(default=None, title='Folder ID', description='ID of the folder where the blog post is stored')
class-attribute
instance-attribute
¶
ID of the folder where the blog post is stored.
handle = Field(..., max_length=255, title='Handle', description='Blog handle that is part of the URL')
class-attribute
instance-attribute
¶
Blog handle that is part of the URL.
json_ld = Field(default_factory=dict, title='JSON-LD', description='Manual override for JSON-LD structured data')
class-attribute
instance-attribute
¶
Manual override for JSON-LD structured data.
name = Field(..., max_length=255, title='Name', description='Name for display and search purposes')
class-attribute
instance-attribute
¶
Name for display and search purposes.
reviewer_ids = Field(default_factory=list, title='Reviewer IDs', description='List of reviewer IDs for the blog post')
class-attribute
instance-attribute
¶
List of reviewer IDs for the blog post.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for the blog post')
class-attribute
instance-attribute
¶
SEO meta information for the blog post.
show_author = Field(default=True, title='Show Author', description='Whether to show contributors and reviewers on the page')
class-attribute
instance-attribute
¶
Whether to show contributors and reviewers on the page.
subtitle = Field(default='', max_length=255, title='Subtitle', description='Subtitle of the blog post')
class-attribute
instance-attribute
¶
Subtitle of the blog post.
summary = Field(default='', title='Summary', description='Blog summary - used for SEO meta description')
class-attribute
instance-attribute
¶
Blog summary - used for SEO meta description if not provided.
template = Field(default=None, title='Template ID', description='ID of the blog page design template.')
class-attribute
instance-attribute
¶
ID of the blog page design template. If template is set, default rich text of the blog post will be ignored. The template must render the blog or use dynamic component in the template
title = Field(..., max_length=255, title='Title', description='User facing title of the blog post')
class-attribute
instance-attribute
¶
User facing title of the blog post.
Blog
¶
Bases: BaseBlog, TimestampedResource
Blog post resource model.
Represents a blog post with content, SEO metadata, and publication status.
contributors = Field(default_factory=list, title='Contributors', description='List of contributors for the blog post')
class-attribute
instance-attribute
¶
List of contributors for the blog post.
pathname = Field(default=None, title='Pathname', description='Full pathname of the blog post')
class-attribute
instance-attribute
¶
Full pathname of the blog post.
preview_url = Field(default=None, title='Preview URL', description='Preview URL of the blog post')
class-attribute
instance-attribute
¶
Preview URL of the blog post.
published = Field(default=False, title='Published', description='Whether the blog post is published')
class-attribute
instance-attribute
¶
Whether the blog post is published.
published_at = Field(None, title='Published At', description='Date and time when the blog post was published')
class-attribute
instance-attribute
¶
Date and time when the blog post was published.
reviewers = Field(default_factory=list, title='Reviewers', description='List of reviewers for the blog post')
class-attribute
instance-attribute
¶
List of reviewers for the blog post.
url = Field(default=None, title='URL', description='Public URL of the blog post')
class-attribute
instance-attribute
¶
Public URL of the blog post. Results in 404 if the blog is not published.
change_handle(new_handle, redirect=False)
¶
Change the handle of the blog post.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the blog post.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the blog post.
unpublish()
¶
Unpublish the blog post.
BlogCreate
¶
Bases: BaseBlog, CreateModel
Model for creating a new blog post.
Contains all required and optional fields for blog post creation.
handle = Field(default=None, max_length=255, title='Handle', description='Blog handle that is part of the URL')
class-attribute
instance-attribute
¶
Blog handle that is part of the URL.
BlogUpdate
¶
Bases: UpdateModel
Model for updating an existing blog post.
All fields are optional for partial updates.
author = Field(default=None, title='Author ID', description='ID of the primary author of the blog post')
class-attribute
instance-attribute
¶
ID of the primary author of the blog post.
content = Field(default=None, title='Content', description='Rich text blocks for the blog post in EditorJS format')
class-attribute
instance-attribute
¶
Rich text blocks for the blog post in EditorJS format.
contributor_ids = Field(default=None, title='Contributor IDs', description='List of contributor IDs for the page')
class-attribute
instance-attribute
¶
List of contributor IDs for the page.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether the blog post is excluded from sitemap')
class-attribute
instance-attribute
¶
Whether the blog post is excluded from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual override for JSON-LD structured data')
class-attribute
instance-attribute
¶
Manual override for JSON-LD structured data.
name = Field(default=None, max_length=255, title='Name', description='Name for display and search purposes')
class-attribute
instance-attribute
¶
Name for display and search purposes.
published_at = Field(default=None, title='Published At', description='Date and time when the blog post was published')
class-attribute
instance-attribute
¶
Date and time when the blog post was published.
reviewer_ids = Field(default=None, title='Reviewer IDs', description='List of reviewer IDs for the blog post')
class-attribute
instance-attribute
¶
List of reviewer IDs for the blog post.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for the blog post')
class-attribute
instance-attribute
¶
SEO meta information for the blog post.
show_author = Field(default=None, title='Show Author', description='Whether to show contributors and reviewers on the page')
class-attribute
instance-attribute
¶
Whether to show contributors and reviewers on the page.
subtitle = Field(default=None, max_length=255, title='Subtitle', description='Subtitle of the blog post')
class-attribute
instance-attribute
¶
Subtitle of the blog post.
summary = Field(default=None, title='Summary', description='Blog summary - used for SEO meta description')
class-attribute
instance-attribute
¶
Blog summary - used for SEO meta description.
template = Field(default=None, title='Template ID', description='ID of the blog page design template.')
class-attribute
instance-attribute
¶
ID of the blog page design template.
title = Field(default=None, max_length=255, title='Title', description='User facing title of the blog post')
class-attribute
instance-attribute
¶
User facing title of the blog post.