Newcomen

Description A static content generator.
Newcomen > Perl Modules > Newcomen::Plugin::Blog::Defaults
Source

Index


NAME ^

Newcomen::Plugin::Blog::Defaults - Sets some defaults for blog pages.

DESCRIPTION ^

This plugin will add default formatters for all blog contents, and set renderer and writer for all blog pages (unless a renderer/writer is already set).

The default formatter(s) will always be added to all Newcomen::Content instances on a page with a creator ID starting with 'Blog::', early during the hook_formatters() hook (see HOOKS). However, formatters will not be added twice, if a formatter of the same name already exists in the content's formatter list, it will not be added again.

The default renderer and writer will be set for all Newcomen::Page instances with a creator ID starting with 'Blog::', unless a renderer or writer is already set for the page. This will be done late during the hook_renderer()/hook_writer() hook, respectively. See HOOKS.

OPTIONS ^

{
   'blog'             => {
      'defaults'      => {
         'page_info'  => {},
         'formatters' => undef,
         'renderer'   => undef,
         'writer'     => undef,
      },
   },
}

These are the default options set by this plugin. They may be overridden by user configuration.

In the following description the term specification refers to either a simple string, in which case it must be the basename of a formatter/renderer/writer backend to be used, i.e. the backend's module name without the 'Newcomen::*::' prefix. In this case no additional backend options will be used. A specification may also be a hashref, in which case it must contain the key name, to specify the backend's basename (as described before), and it may contain another key options, which must be set to a hashref containing the backend options to be used (the options hashref may be empty). See the individual backends for details on their options. Other keys in the specification hashref will be ignored. Backend names are case sensitive.

blog/defaults/formatters, if set, must either be a single formatter specification or an arrayref containing an arbitrary number of formatter specifications, as described above.

blog/defaults/renderer and blog/defaults/writer must be set to a renderer/writer specification (as described above) that should be used for blog pages.

Any of these three options may also be set to undef (the default), in which case no defaults will be applied to any content item's and/or pages. Setting blog/defaults/formatters to an empty arrayref has the same effect as setting it to undef.

The blog/defaults/page_info option must be set to a hashref. It may be empty (the default). Several other plugins use this hashref to set additional meta data for the pages. The documentation of these plugins will contain a reference to this option if it is used, as well as a description of the processing of its contents.

HOOKS ^

This plugin implements the following hooks: hook_formatters() (priority 100), hook_renderer() (priority 900) and hook_writer() (priority 900).

SEE ALSO ^

Newcomen::Content, Newcomen::Formatter, Newcomen::Page, Newcomen::Renderer, Newcomen::Writer

VERSION ^

This is version 2014052501.

AUTHOR ^

Stefan Goebel - newcomen {at} subtype {dot} de

COPYRIGHT AND LICENSE ^

Copyright 2013-2014 Stefan Goebel.

This file is part of Newcomen.

Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.

Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.