NAME
Chronicle::Plugin::TruncatedBody - Support for Truncating longer blog posts.
DESCRIPTION
The module allows you to truncate longer blog posts.
To use this you need to add __CUT__
within the post body to the start of its own separate line.
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.
If the new entry has a __CUT__
on its own line, the text before the cut is marked as part of the truncated body and a link pointing the reader to the rest of the article.
The body text is then cleaned by removing __CUT__
.
:NOTE If there are multiple __CUT__'s within a file, only the first correctly placed __CUT__ will be used. Other __CUTS__ will be ignored and will remain within the body and or in the truncated body in the case of a incorrectly placed __CUT__ prior to a correctly placed __CUT__.
LICENSE
This module is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Perl "Artistic License".
AUTHOR
Stuart Skelton