# Blosxom Plugin: scase # Author: Sehrgut # Version: 1 # Documentation: See the bottom of this file or type: perldoc scase package scase; use strict; sub start { # Convert $blosxom::path_info to /Sentence/Case $blosxom::path_info=~ s!(\w+)!\u\L$1!g; } sub story { # Convert $blosxom::path to lowercase # $blosxom::path=lc($blosxom::path); } 1; __END__ =head1 NAME Blosxom plugin: scase =head1 SYNOPSIS Sentence Case (SCase) SCase allows the use of capitalized directory names without losing the ability to resolve lowercase URIs. Currently only makes the path case- insensitive: filenames in permalinks are still case-sensitive. =head1 INSTALLATION AND CONFIGURATION There are no user-configured variables. Simply drop into your Blosxom plugins directory. Since SCase munges some core Blosxom variables, it needs to load before anything else uses $path 1. Converts the requested path, $blosxom::path_info, to sentence case allowing all-lowercase urls to be used. This is useful since very few people (in the ordinary, mundane sense of the word: I would never be grouping anyone who would have occasion to read this as one of the masses) know that URIs are case-sensitive. Out of laziness, most people type only lowercase letters, even if the path contains uppercase letters. This allows an all-lowercase path to "find" its capitalized counterpart. 2. Provides all-lowercase story path ($blosxom::path) to be used in links. To turn this option on, uncomment line 18. Really only useful if you are using capitalized directory names but for some reason only want to present lowercase links to the world at large. Future Work: I'd like to extend the functionality to case-insensitive file- names ($blosxom::$fn), for truly case-insensitive permalinks. Unfortunately, that's a bit out of my league. Some help, maybe? =head1 VERSION 2005-06-20 =head1 AUTHOR Sehrgut sehrgut co uk>, http://sehrgut.co.uk/ =head1 ACKNOWLEDGEMENTS This plugin was inspired by the lcase plugin by Jonathan Lundquist http://www.fluxsmith.com/weblog/2003/06/23#lcase. =head1 SEE ALSO Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/ Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml =head1 BUGS Address bug reports and comments to the Blosxom mailing list [http://www.yahoogroups.com/group/blosxom]. =head1 LICENSE scase Blosxom plugin copyright 2005 Sehrgut http://sehrgut.co.uk/foaf/foaf.rdf 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.