AutoPublish

This Kirby plugin will auto publish a page when a toggle is enabled and a date set.

Installation

Use one of these methods to install the plugin:

  • composer (recommended): composer require konzentrik/konzentrik
  • zip file: unzip main.zip as folder site/plugins/autopublish

Usage

Add panel fields

Add the autopublish field to your page blueprint:

fields:
  autopublish: fields/autopublish

Or add the toggle and date field by yourself:

fields:
  autopublish:
    label: Autopublish
    type: toggle
    translate: false
  autopublishDate:
    label: Autopublish Date
    type: date
    time: true
    translate: false
    when:
      autopublish: true

If you already have a date field you want to use, you can configure the plugin to use it, by setting this option in your config.php

'konzentrik.autopublish.dateField' => 'my-date-field',

Configure and use the webhook

First set a secret in your config.php:

'konzentrik.autopublish.secret' => 'my-secret',

You can now trigger the Webhook:

https://example.com/autopublish/cron/my-secret

Replace example.com with your hostname and my-secret with the secret you set in your config.php. Whenever you trigger the Webhook the plugin will look for unpublished pages with a date older or equal to the current date-time and then publishes the page.

Options

Please make sure to prefix all options with konzentrik.autopublish or use the array notation.

Option Default Description
dateField 'autopublishDate' The field name of your date field
secret '' A secret to secure the webhook
You can comment on this post from your blog.

This post reacts to webmentions. You can link it from your website and send a webmention. Your contribution will then appear in the comments here. Does your site not support webmentions? Enter the link to your post here:

Write a comment
By submitting your data, you agree that all entered data may be saved and displayed as a comment.
Like, Share, Reply

I'd love to hear from you! Did you enjoy this post? Leave a comment, link your blog post, or react on Mastodon and Bluesky.

Reactions

  • konzentrik.de