The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Chronicle::Plugin::SkipDrafts - Ignore draft posts.

DESCRIPTION

If your blog-post contains a "draft: 1" header then it will not be inserted into the blog.

METHODS

Now follows documentation on the available methods.

on_insert

The on_insert method is automatically invoked when a new blog post must be inserted into the SQLite database, that might be because a post is new, or because it has been updated.

The method is designed to return an updated blog-post structure, after performing any massaging required. If the method returns undef then the post is not inserted.

Here we look for a draft:1 header in the post, if one is found then the method returns undef which causes it to be excluded from the blog generation process.