Skip to content

Instantly share code, notes, and snippets.

@hrkokw
Last active September 4, 2021 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrkokw/2906a404fc947752367edc1d1a53eed9 to your computer and use it in GitHub Desktop.
Save hrkokw/2906a404fc947752367edc1d1a53eed9 to your computer and use it in GitHub Desktop.
Blosxom more plugin
# -*- mode: perl -*-
# vim: syntax=perl
#
# https://88171.net/blosxom-more-plugin
package more;
use strict;
use warnings;
our $truncated = 0;
sub start {
$blosxom::flavour eq $blosxom::default_flavour
&& $blosxom::path_info !~ /\.$blosxom::default_flavour$/;
}
sub story {
my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
$truncated = $$body_ref =~ s/^(.{1024}.*?)(?:\r?\n){2}.*/$1/s;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment