# Blosxom Plugin: preface # Author(s): KITAMURA Akatsuki # Version: 2004-09-23 # Blosxom Home/Docs/Licensing: http://www.blosxom.com/ # This script is encoded in UTF-8. package preface; use strict; # --- Configurable variables ----------- # 前文の省略値 my $preface = "眠。"; # --- Plug-in package variables -------- my $is_top_entry; my $placeholder = "{{{preface}}}"; # -------------------------------------- sub start { return 0 if ($ENV{PATH_INFO} !~ m{^/?$}); $is_top_entry = 1; $blosxom::blog_description = $placeholder; 1; } sub story { return 1 unless ($is_top_entry); # ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; my $body = ${$_[5]}; foreach my $line (split(/\n/, $body)) { if ($line =~ m{}) { $preface = $1; } } $is_top_entry = 0; 1; } sub foot { $blosxom::output =~ s{$placeholder}{$preface}; 1; } 1; __END__ =head1 NAME Blosxom Plug-in: preface =head1 SYNOPSIS 目的: トップページを表示した時に、$blog_descriptionに入る文字列を 更新のたびごとに変更するためのプラグインです。 最新の記事中に埋め込まれたコメント の中の 文字が$blog_descriptionと置き換わります。 =head1 VERSION 2004-09-23 =head1 AUTHOR 北村曉 (KITAMURA Akatsuki) http://www.akatsukinishisu.net/