diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2022-08-10 18:42:13 +0200 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2022-08-10 19:11:42 +0200 |
commit | 51497a91d412dd7f03824ec58a039d371e8b1bfa (patch) | |
tree | 87a0694e806fc5b7feeba7defef4754669329376 /makesite.pl | |
parent | c8a6c4eed5011758d8eaa18639cc546b017d922b (diff) |
rss feed: add description
Diffstat (limited to 'makesite.pl')
-rwxr-xr-x | makesite.pl | 15 |
1 files changed, 11 insertions, 4 deletions
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; |