summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-11-19 12:22:54 +0530
committerAndinus <andinus@nand.sh>2020-11-19 12:22:54 +0530
commit9c5a8783e922b23621e4cf94612fd2d54b668f8a (patch)
treee2180f59f6a261ebbfa6b75c704a7cab13a4430b
parent04b437bcbd26480d60e4c514ff32bbeacf8881e7 (diff)
downloaddraco-9c5a8783e922b23621e4cf94612fd2d54b668f8a.tar.gz
Link the post title to url
-rwxr-xr-xdraco.pl7
1 files changed, 3 insertions, 4 deletions
diff --git a/draco.pl b/draco.pl
index 6209123..bd5be36 100755
--- a/draco.pl
+++ b/draco.pl
@@ -53,8 +53,8 @@ my $date = strftime '%+', localtime();
 print "#+", "DATE: $date\n";
 print "\n";
 
-# Print the post title.
-print "* ", "$post->{title}\n";
+# Print the post title & it's link.
+print "* ", "[[$post->{url}][$post->{title}]]\n";
 
 # Add various details to :PROPERTIES:.
 print ":PROPERTIES:\n";
@@ -65,13 +65,12 @@ foreach my $detail (qw( subreddit created_utc author permalink
 }
 print ":END:\n";
 
-# Add selftext/url if present.
+# Add selftext if present.
 print "\n#+BEGIN_SRC markdown\n",
     # Break the text at 76 column & add 2 space before every new line.
     "  ", $lb->break($post->{selftext}) =~ s/\n/\n\ \ /gr, "\n",
     "#+END_SRC\n"
     if scalar $post->{selftext};
-print "$post->{url}\n" if scalar $post->{selftext};
 
 # $comments contains comment data. We are interested in: replies,
 # author, body, created_utc & permalink.