summaryrefslogtreecommitdiff
path: root/makesite.pl
diff options
context:
space:
mode:
Diffstat (limited to 'makesite.pl')
-rwxr-xr-xmakesite.pl15
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;