diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2025-02-21 21:27:31 +0100 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2025-02-21 21:27:31 +0100 |
commit | 55e5a75b20469629f1a958c12dfee823527078a1 (patch) | |
tree | a92eb722113ce8123e01f3909f58db2eb189ed0b /makesite.pl | |
parent | 2a81482dd6d2a17a253e83becc6a042010680c9d (diff) |
rss feed: full articles
Diffstat (limited to 'makesite.pl')
-rwxr-xr-x | makesite.pl | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/makesite.pl b/makesite.pl index 77ab6f1..978257f 100755 --- a/makesite.pl +++ b/makesite.pl @@ -65,17 +65,6 @@ 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 @@ -91,7 +80,7 @@ while(<*.md>) { my $year = substr $articleFile, 0, 4; my $month = substr $articleFile, 4, 2; my $day = substr $articleFile, 6, 2; - my $articleData = { date => "$month-$day-$year", title => $headLine, address => $pageFile, description => $description }; + my $articleData = { date => "$month-$day-$year", title => $headLine, address => $pageFile, description => $articleContent }; push @articleList, $articleData; } @@ -124,6 +113,8 @@ for(my $i = $#articleList; $i >= 0; $i--) { my $url = $BASE_URL . $articleList[$i]{address}; my $pubDate = Time::Piece->strptime($articleList[$i]{date}, "%m-%d-%Y"); $pubDate = $pubDate->strftime("%a, %d %b %Y %H:%M:%S %z"); + # No relative link in RSS feed + $articleList[$i]{description} =~ s/href="\//href="$BASE_URL/g; while(<$inHandle>) { $_ =~ s/\$title/$articleList[$i]{title}/; $_ =~ s/\$link/$url/; |