summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmakesite.pl15
-rw-r--r--template/rss-item.xml4
2 files changed, 6 insertions, 13 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/;
diff --git a/template/rss-item.xml b/template/rss-item.xml
index 0a86187..f27bf1a 100644
--- a/template/rss-item.xml
+++ b/template/rss-item.xml
@@ -1,7 +1,9 @@
<item>
<title>$title</title>
<link>$link</link>
-<description>$description</description>
+<description><![CDATA[
+$description
+]]></description>
<guid isPermaLink="false">$guid</guid>
<pubDate>$pubDate</pubDate>
</item>