From 51497a91d412dd7f03824ec58a039d371e8b1bfa Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Wed, 10 Aug 2022 18:42:13 +0200 Subject: rss feed: add description --- makesite.pl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'makesite.pl') diff --git a/makesite.pl b/makesite.pl index 92064c5..83bbce4 100755 --- a/makesite.pl +++ b/makesite.pl @@ -57,16 +57,23 @@ while(<*.md>) { open my $articleHandle, "<", $articleFile; my $headLine = <$articleHandle>; $headLine = substr $headLine, 2, -1; + + # Extract description : first paragraph of the article + my $description = ""; + while(my $line = <$articleHandle>) { + if($. == 5) { + $description = $line; + last; + } + } + $description =~ s/\R//; # remove any new line + $description .= ".."; # to have "..." at the end of description close $articleHandle; # Extract output file name: MD file name without the date my $pageFile = substr $articleFile, 9, -3; $pageFile .= ".html"; - # Extract description - # TODO - my $description = ""; - # Build article my $articleContent = read_file $articleFile; $articleContent = markdown $articleContent; -- cgit v1.2.3