index: link scope in git messages to existing page
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 7 Nov 2021 04:40:47 +0000 (05:40 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Nov 2021 03:14:15 +0000 (04:14 +0100)
Assumes prefix matches page names.

index.plp

index 468e92731e84ec4d421f620895dd43416b61f340..7377784883e643d3bc971dbbf0691d9e661510f9 100644 (file)
--- a/index.plp
+++ b/index.plp
@@ -35,6 +35,7 @@ if (open my $log, '<', 'UPDATE') {{
        EscapeHTML $line;
        my ($date, $subject) = split /[\t\n]/, $line;
        $date =~ s/ \K/<small>/ and $date .= '</small>';
+       $subject =~ s{\A(\w+)(?=: )}{showlink($1, -e "$1.plp" && "/$1")}e;
        say "<p><strong>Last update</strong>: $date $subject</p>";
 }}