Description | A static content generator. |
Newcomen::Plugin::Blog::Feed::Main - Creates the feed for the main index page.
This plugin may be used to generate the atom feed for the main index page created by the plugin Newcomen::Plugin::Blog::Index::Main.
Please read the documentation of Newcomen::Plugin::Blog::Index::Main first!
A new collection will be created for the feed, based on the original index collection. The
collection's ID and the creator will both be set to 'Blog::Feed::Main'
. The index collection's
meta data will be copied to the new collection, and all the sources from the index collection will
be added to the feed collection. Sorting of the feed collection is independent from the index
collection, see OPTIONS.
The meta data atom_url will be set for the original index collection. Its value will be the page target (the URL of the feed).
One page will be created for the feed. The page's creator will be set to 'Blog::Feed::Main'
. The
target and the number of articles will be set to the configured values, see OPTIONS. The
page's collection attribute will be set to the source collection of the feed page. See
META DATA for details on the meta data of the page.
An entry in the global URL map (see Newcomen::URL) will be created for the feed page. The key
will be set to 'Blog::Feed::Main'
.
{ 'blog' => { 'feed' => { 'main' => { 'url' => undef, 'ascending' => undef, 'entries' => undef, 'feed_info' => {}, 'formatters' => undef, 'renderer' => undef, 'writer' => undef, }, }, }, }
These are the default options set by this plugin. They may be overridden by user configuration.
url specifies the page target.
ascending sets the order of the articles in the feed. If set to a true value, articles will be
in ascending order, i.e. oldest first. If this is undef
(the default), the value of the option
blog/feed/defaults/ascending will be checked. If this, too, is not set, it defaults to false.
Note that the order is determined by the modification time, not the publication time as is used for the index pages!
entries specifies the number of articles in the feed. If this is undef
(the default), the
value of the option blog/feed/defaults/entries will be checked. If this, too, is not set, it
defaults to 5
. If entries is set to 0
, all articles will be included in the feed.
The feed_info hashref may be used to set arbitrary data that will be included in the page's meta
data. Everything set in this hashref will be included in the meta data, with the original keys being
prefixed with 'atom_'
. Before being copied to the meta data, this hashref will be merged with
the hashrefs specified by the blog/feed/defaults/feed_info and blog/defaults/page_info
options, with more specific data overriding less specific data if necessary.
Note that if there is no uuid key in the feed_info hashref (after merging), a UUID will be created for the feed. For this to work, the setting blog/feed/defaults/uuid_ns has to be set, please see Newcomen::Plugin::Blog::Feed::Defaults for details. If this options is not set, and there is no UUID in the info hashref, this plugin will die().
Also, if there is no updated key in the feed_info hashref, the atom_updated meta data will be set automatically based on the modification time information of the sources.
formatters, renderer and writer may be used to specify formatter backends for the feed
content, and renderer/writer backends for the feed page. The format is the same as described for the
options in Newcomen::Plugin::Blog::Defaults, please see there for details. If these are undef
(the default), no backends will be set, and another plugin may set these.
{ 'order_ascending' => <ascending configuration option>, 'atom_url' => <URL of the Atom feed (see description!)>, }
The order_ascending configuration option (determined as described above) will be included in the collection meta data of the feed collection.
The atom_url will be set to the feed URL (page target) for the index collection (created by the Newcomen::Plugin::Blog::Index::Main plugin), not the feed collection!
{ 'atom_uuid' => <UUID for the Atom feed>, 'atom_updated' => <last modification time>, }
All meta data specified in the feed_info hashref (see OPTIONS) will be set for the
pages, keys will be prefixed by 'atom_'
. Additionally, even if the feed_info hashref does not
contain the uuid and updated keys, atom_uuid and atom_updated will be set for every page
(if these are included in the feed_info hashref, the configured values will be used).
This plugin implements the following hooks (with default priority unless stated otherwise):
hook_build_collections() (priority 600
), hook_build_pages(), hook_formatters(),
hook_renderer(), hook_writer().
Newcomen::Plugin::Blog::Defaults, Newcomen::Plugin::Blog::Feed::Defaults, Newcomen::Plugin::Blog::Index::Main, Newcomen::URL
This is version 2014052501
.
Stefan Goebel - newcomen {at} subtype {dot} de
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/>.