# Blosxom Plugin: permalink # Author(s): Kyo Nagashima # Version: 2012-04-05T15:28:39+09:00 # Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/ # see http://hail2u.net/blog/blosxom/efficient-plugin.html package permalink; use strict; use vars qw($title $title_sep); # --- Configurable variables ----------- # separator string between $blog_title and $title my $str_title_sep = " - "; # --- Plug-in package variables -------- my $title_placeholder = '{{{permalink::title}}}'; my $t; # -------------------------------------- sub start { if ($blosxom::path_info !~ /\.\Q$blosxom::flavour\E$/) { return 0; } $title = $title_placeholder; $title_sep = $str_title_sep; return 1; } sub story { my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $t = $$title_ref; return 1; } sub last { $blosxom::output =~ s/$title_placeholder/$t/m; } 1; # vim:ft=perl: