# Blosxom Plugin: meta # Author(s): Rael Dornfest # Version: 2.0b4 # Documentation: See the bottom of this file or type: perldoc readme package meta; # --- Configurable variables ----- # What prefix should I expect prepended to each meta tag? my $meta_prefix = 'meta-'; # -------------------------------- sub start { 1; } sub story { my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $$_ = undef foreach @keys; @keys = (); my($body, $in_header) = ('', 1); foreach ( split /\n/, $$body_ref ) { /^\s*$/ and $in_header = 0 and next; if ( $in_header ) { my($key, $value) = m!^$meta_prefix(.+?)\s*:\s*(.+)$!; $key =~ /^\w+$/ and push(@keys,$key) and $$key = $value and next; } $body .= $_ . "\n"; } $$body_ref = $body; return 1; } 1; __END__ =head1 NAME Blosxom Plug-in: meta =head1 SYNOPSIS Purpose: Populates the $meta namespace with variables corresponding to meta tags found in the "header" (anything before a blank line) of a weblog post, removing the meta tags along the way. These variables are available to plug-ins and flavour templates as $meta::variablename. =head1 VERSION 2.0b4 Version number coincides with the version of Blosxom with which the current version was first bundled. =head1 AUTHOR Rael Dornfest , http://www.raelity.org/ This plugin is now maintained by the Blosxom Sourceforge Team, . =head1 SEE ALSO Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/ Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html =head1 BUGS None known; please send bug reports and feedback to the Blosxom development mailing list . =head1 LICENSE Blosxom and this Blosxom Plug-in Copyright 2003, Rael Dornfest Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.