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::Snippets::RecentPosts - Generate recent posts.

DESCRIPTION

This module will be invoked automatically when your site is built via the on_generate hook which Chronicle provides.

It is responsible for creating the a data-structure to show recent posts. The number of posts defaults to ten, but can be changed if you're using a configuration file, via:

   recent-post-count = 20

To use this in your theme add the following:

     <!-- tmpl_if name='recent_posts' -->
     <h3>Recent Posts</h3>
     <ul>
       <!-- tmpl_loop name='recent_posts' -->
       <li><b><!-- tmpl_var name='date' --></b>
       <ul>
          <li><a href="<!-- tmpl_var name='top' --><!-- tmpl_var name='link' -->"><!-- tmpl_var name='title' --></a></li>
       </ul></li>
       <!-- /tmpl_loop -->
     </ul>
     <!-- /tmpl_if name='recent_posts' -->

AUTHOR

Steve Kemp <steve@steve.org.uk>

COPYRIGHT AND LICENSE

Copyright (C) 2014 Steve Kemp <steve@steve.org.uk>.

This library is free software. You can modify and or distribute it under the same terms as Perl itself.