Write and publish a post

v0.0.3

A post is the blog's main record. You write it in the admin, keep it as a draft while you work, and publish it when it is ready. Visitors see a post only while its status is Published. This guide creates a post, publishes or schedules it, and then shows how to take it down, review its history and archive it.

Before you begin

  • Set the blog up on your site.
  • Sign in with an account that holds admin:dashboard:blog:post, or a wildcard that covers it.
  • Create the collections, tags and bloggers you want to attach, as in Add categories, tags, bloggers and teams. You can also attach them later by editing the post. A post names its authors through bloggers, so a post with no blogger shows no author.

Create the post

  1. In the admin sidebar, under Plugins, click Blog. Then click the Blog Posts card, or click New Post in the header. The page is titled Blog Posts Management.
  2. Click Add Post.
  3. Enter a Title. The Slug follows the title until you type your own. A slug is lowercase, joins words with -, keeps _ inside a word and drops accents, so Café becomes cafe. It keeps the letters of the languages the site publishes in, and Latin letters only on a site with no language set. A title with no letter of those scripts is refused with uses letters or digits that the site languages do not allow in a slug, so write the slug with letters of the site's languages.
  4. Leave Status on Draft. Check the Language, which is the post's language code, such as en.
  5. Under Collections, Bloggers / Authors and Tags, search and select the records the post belongs to.
  6. Write the body in Content, as described in the next section.
  7. Optionally fill in Subtitle, Excerpt and Featured Image, and turn on Featured.
  8. Click Create. The page confirms with Post created successfully.

the Add Post form open over the Blog Posts Management page, with Title, Slug, Status, Language and the Content editor toolbar visible

The post form keeps the relationships above the content.

A post needs a title, a slug, content, a status and a language. The slug must be unique on the site, and it cannot be the address of a page the site already serves. See Blog record fields for every field and its limits.

Write the content

Content is a rich-text editor. Its toolbar has Paragraph, Heading 2 to Heading 4, Bold, Italic, Link, Table, Bulleted list, Numbered list, Quote, Code block, Divider, Undo and Redo. The Components button opens a palette of your site's components, which you can place inside the text.

When you save, the blog does four things with the content:

  • It cleans the HTML.
  • It colours code blocks. A code block whose language is elixir, heex, eex, erlang, html, json, diff, sql, javascript, typescript or css is highlighted. Pick the language with Code language. Other languages stay plain.
  • It works out the reading time, at 200 words a minute and never under one minute.
  • It records which components, icons and classes the content uses, so the site's stylesheet carries them once the post is published.

Add a cover image

In Featured Image, drop a file, or choose one from the site's media library. Uploads are filed in a folder named blog. The field stores the picture's address.

Publish the post

  1. On the Blog Posts Management page, find the post's card.
  2. Click Publish. In the table view, the action is in the Actions menu.

A card shows Publish only on a draft or a scheduled post, and Unpublish only on a published or a scheduled one. The status chip changes to Published, and the post's publish date is set if it had none. The post now appears on the blog pages that list posts, and in the blog's search box. If its content uses a component or class the site did not use before, the site's stylesheet is rebuilt.

The Blog Posts Management page with two post cards: a published post with Edit, Delete, Versions and Unpublish, and a draft post with Edit, Delete, Versions and Publish.

A published card offers Unpublish, and a draft card offers Publish.

Click Unpublish to take a post down. It returns to Draft and its publish date is cleared. You can also change Status in the edit form.

If the post, or a collection it is filed under, has a Permissions value, only readers who hold one of those permissions can open it. See How blog locks work and Lock a page or post to members.

Schedule a post

A scheduled post goes live at the time you set.

  1. In the post form, set Status to Scheduled. The Publish At field appears. It is asked for only while the status is Scheduled.
  2. Pick the date and time in Publish At. The time is in UTC. On a new post, the calendar greys out the days before today.
  3. Click Create, or Save Changes on an existing post.

A scheduled post stays out of the public pages. When its time comes, a job publishes it. The post's publish date is the time you set, its schedule is cleared, and the publish notifies as any other does. The host runs that job once a minute, as Set up the blog on a site shows.

A time you set that has already passed is refused with Publish At must be in the future. A scheduled post with no time is refused with Scheduled publish time is required for scheduled posts. Saving a post without changing its time never raises the first error, so an older scheduled post is still saved as it is.

Click Publish on a scheduled post to publish it now. Its time is cleared. Unpublish on a scheduled post returns it to Draft and clears its time too, so the old schedule never publishes it. To schedule over the API, see Blog JSON:API.

Who can publish

A blogger whose profile on the post's site does not have Can Publish Directly cannot publish or schedule a post. This holds for the Publish and schedule actions and for saving a post as Published or Scheduled. The blogger is told Your blogger profile can't publish directly. Save the post as a draft for an editor to publish.

These accounts are not blocked: a master, an account that holds admin:dashboard:blog:publish (admin:api:blog:publish on the API, or a wildcard that covers it), and an editor with no blogger profile on the site. The job that publishes scheduled posts is not blocked either. A plugin on blog:post:can_publish may change the answer. See Blog permissions and Blog plugin events.

Review and restore earlier versions

  1. Click Versions on the post. A window titled Version history lists every saved change, newest first.
  2. Each entry shows the time, the action, who made the change and the fields that changed. Click Show to read the changed values under Version changes, and Hide to close them.
  3. To go back, click Restore and confirm. The page confirms with Version restored successfully.

the Version history window with the newest entry marked Current, and the Show and Restore buttons on each entry

Restore copies the saved values back onto the post.

A restore copies back the post's own fields, such as the title, content, status and SEO tags. It does not change which collections, tags and authors the post has. A restored version is highlighted again and its reading time is worked out again. A post that is archived cannot be restored from a version until you restore it from the archive.

Archive and restore a post

  1. Click Delete on the card and confirm. The post is archived, not removed, and leaves the lists and the public pages.
  2. To bring it back, switch the list to Archived with the toggle beside Active, then click Restore. The post returns as a draft.
  3. To remove it for good, click Delete forever on an archived post. This cannot be undone.

An archived post cannot be edited. To archive or delete several posts at once, tick their cards and use the bulk bar. A post that is the original of live translations cannot be archived until its translations are. See Publish a post in more than one language.

Next steps