1 # Blosxom Plugin: flavourpathinfo
2 # Author(s): Gavin Carr <gavin@openfusion.com.au>
4 # Documentation: 'perldoc flavourpathinfo'
6 package flavourpathinfo;
10 # --- Configurable variables -----
14 # --------------------------------
16 my $package = 'flavourpathinfo';
18 my ($level, @msg) = @_;
20 if ($debug_level >= $level) {
21 print STDERR "$package debug $level: @msg\n";
26 my $path_info = $blosxom::path_info;
27 return 1 if -e "$blosxom::datadir/$path_info";
28 debug(1, "original path_info: $path_info");
31 if ($path_info =~ m!^(.*)/([^/]+)$!) {
33 $path_info = "$1.$flavour";
34 my $path_file = "$1.$blosxom::file_extension";
36 debug(1, "path_file: $path_file");
37 debug(1, "munged path_info: $path_info");
39 if (-f "$blosxom::datadir/$path_file") {
40 debug(1, "munged \$path_info exists - updating \$blosxom::path_info");
41 $blosxom::path_info = $path_info;
42 $blosxom::flavour = $flavour;
43 $blosxom::path_info_yr = undef;
56 flavourpathinfo - allows flavour designation via a trailing path component
57 instead of via a file extension
61 flavourpathinfo is a syntactic sugar plugin that allows flavour designation
62 via a trailing path component instead of via a file extension e.g.
64 http://blog.example.com/category/post/html
65 http://blog.example.com/category/post/atom
66 http://blog.example.com/category/post/trackback
68 instead of the more typical:
70 http://blog.example.com/category/post.html
71 http://blog.example.com/category/post.atom
72 http://blog.example.com/category/post.trackback
76 Should be loaded early as it manipulates $blosxom::path_info
77 e.g. as 00flavourpathinfo.
83 Blosxom: http://blosxom.sourceforge.net/
87 Please report bugs either directly to the author or to the blosxom
88 development mailing list: <blosxom-devel@lists.sourceforge.net>.
92 Gavin Carr <gavin@openfusion.com.au>, http://www.openfusion.net/
96 Copyright 2007 Gavin Carr.
98 This plugin is licensed under the same terms as blosxom itself i.e.
100 Permission is hereby granted, free of charge, to any person obtaining a
101 copy of this software and associated documentation files (the "Software"),
102 to deal in the Software without restriction, including without limitation
103 the rights to use, copy, modify, merge, publish, distribute, sublicense,
104 and/or sell copies of the Software, and to permit persons to whom the
105 Software is furnished to do so, subject to the following conditions:
107 The above copyright notice and this permission notice shall be included
108 in all copies or substantial portions of the Software.
110 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
111 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
112 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
113 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
114 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
115 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
116 OTHER DEALINGS IN THE SOFTWARE.