Description | A static content generator. |
Newcomen::Plugin::Blog::Source::Lists - Creates meta data lists.
This plugin will will create meta data lists (i.e. arrayrefs) from existing meta data entries for
all Newcomen::Source instances with the creator ID 'Blog::Crawler'
. It will be done early
during the hook_process_source() hook (priority 200
).
The existing (scalar) entries will be split at commas (spaces before and after a comma will be removed), empty elements will be ignored. The meta data to be processed can be freely configured, see below. By default, no lists will be created.
Note: For every configured key to be processed a list will be created. This list may be empty, if
the original data was empty or did not exist. Additionally, the original data will be cleaned up: it
will be set to the list joined by ', '
(comma, followed by a space). Again, this may be an empty
string if the original data was empty or did not exist. However, if the target key already exists in
the meta data, it will not be overridden (the original data will still be cleaned up, though).
{ 'blog' => { 'source' => { 'lists' => {}, }, }, }
These are the default options set by this plugin. They may be overridden by user configuration.
The blog/source/lists option has to be a hashref (or undef
, if you know what you are doing).
The keys of the hashref specify the meta data to be processed, the values specify the name of the
list that will be created for the key. Nested data is supported, using the slash ('/'
) as
separator.
For example, to split the meta data category and tag, and store the resulting lists in the meta data as categories and tags, respectively, use:
{ 'blog' => { 'source' => { 'lists' => { 'category' => 'categories', 'tag' => 'tags', }, }, }, }
Meta data will be processed and created according to the user configuration. For more details see the DESCRIPTION and OPTIONS.
This plugin implements the hook hook_process_source() (priority 200
).
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/>.