bliper

static html page generation in perl
git clone git://git.2f30.org/bliper
Log | Files | Refs | README | LICENSE

commit 0f2cdc66d6b3f7a7d541a478a787b2016d47e941
parent 2f8296e201eff61e7d39206f8fd156930eeacdc7
Author: cipher <haris@2f30.org>
Date:   Thu, 11 Dec 2014 15:08:47 +0200

Add links to titles in article previews in index.html.

Diffstat:
Mbin/bliper-generate.pl | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/bliper-generate.pl b/bin/bliper-generate.pl @@ -79,7 +79,9 @@ foreach my $file (@files) { # Read each file(post) from indir, cat to $outdi close OUT; my @preview_array = split(/\n{2,}/, $html); # Pull title and first paragraph from article. - $preview_array[0] =~ s/<h1/<h3/g; # Change h1 to h3 for the index page. + $preview_array[0] =~ s/h1>/h3>/g; # Change h1 to h3 for the index page. + $preview_array[0] =~ s/<h3>/<a href=\"$file.html\"><h3>/g; + $preview_array[0] =~ s/<\/h3>/<\/h3><\/a>/g; if ($i < $previewnum) { # Append links to stories in index.html open (OUT, '>>', "../$outdir/index.html") or die $!;