App-Chronicle

 view release on metacpan or  search on metacpan

bin/chronicle  view on Meta::CPAN

do - They are invoked first and can update the global variables to make some
new data available to all the templates.

This is how the global tag-cloud, recent posts, and similar data is able
to be included in the sidebar in the default template.

=item How do I generate non-English dates?

Chronicle uses the L<Date::Language> module for generating localized dates.
For each of the variables "date", "time" and "date_short" there exists a
corresponding variable with the suffix "_loc" ("date_loc" etc.) that
contains the localized version.

For historical reasons, the language is configured via the environment variable
C<$MONTHS>. For example, to get Finnish dates, you could use:

=for example begin

    MONTHS=Finnish chronicle ...

=for example end

=item How do I ignore draft-posts?

If you add the header C<draft: 1> to your pending post then it will
be excluded from the blog, via the L<Chronicle::Plugin::SkipDrafts>
plugin.

=item How do I schedule future-posts?

If you add a C<publish:> header, rather than a C<date:> header, to your
posts it will allow you to schedule the release of future posts via the
L<Chronicle::Plugin::PostSpooler> plugin.

=back

=cut

=head1 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".

=cut

=head1 AUTHOR

Steve Kemp <steve@steve.org.uk>

=cut


use strict;
use warnings;
use open ':std' => ':locale';
use open IO     => ':encoding(UTF-8)';

package Chronicle;
use Module::Pluggable::Ordered require => 1, inner => 0;

our $VERSION = "5.1.8";

use DBI;
use Date::Format;
use Date::Parse;
use Digest::MD5 qw(md5_hex);
use File::Basename;
use File::Find;
use File::Path;
use File::ShareDir;
use Getopt::Long;
use HTML::Element;
use Pod::Usage;

use Chronicle::Utils qw/ format_datetime /;
use Chronicle::URI;
use Chronicle::Config::Reader;
use Chronicle::Template;

#
#  Default options - These may be overridden by the command-line
# or via the configuration files:
#
#   /etc/chronicle/config
#   ~/.chronicle/config
#
#  NOTE: These filenames were deliberately chosen to avoid clashing
# with previous releases of chronicle.
#
our %CONFIG;
$CONFIG{ 'input' }        = "./data";
$CONFIG{ 'pattern' }      = "*.txt";
$CONFIG{ 'output' }       = "./output";
$CONFIG{ 'database' }     = "./blog.db";
$CONFIG{ 'comment-days' } = 10;
$CONFIG{ 'entry-count' }  = 10;
$CONFIG{ 'rss-count' }    = 10;

$CONFIG{ 'theme-dir' } = File::ShareDir::dist_dir('App-Chronicle');
$CONFIG{ 'theme' }     = "default";
$CONFIG{ 'unicode' }   = "no";
$CONFIG{ 'verbose' }   = 0;
$CONFIG{ 'top' }       = "/";
$CONFIG{ 'exclude-plugins' } =
  "Chronicle::Plugin::Archived,Chronicle::Plugin::Verbose";
$CONFIG{ 'template-engine' } = "HTMLTemplate";

our %DATABASE_SCHEMA = (
    blog => {
        columns =>
          [qw/ id file date title link mtime body truncatedbody template /],
        create => [
            'CREATE TABLE blog (id INTEGER PRIMARY KEY,file,date,title,link,mtime,body,truncatedbody,template )',
            'CREATE UNIQUE INDEX unique_title on blog (title)',
        ],



( run in 1.353 second using v1.01-cache-2.11-cpan-ceb78f64989 )