replacing hyphens with spaces in post names
authorMatthewOwens <matthew@owens.tech>
Tue, 21 Jul 2020 16:46:50 +0000 (17:46 +0100)
committerMatthewOwens <matthew@owens.tech>
Tue, 21 Jul 2020 16:46:50 +0000 (17:46 +0100)
scripts/posts.awk

index b78d008..4f29e6a 100644 (file)
@@ -6,7 +6,8 @@ BEGIN {
 
 {
        file = sprintf("%s-%s-%s-%s", $1, $2, $3, $4)
-       string = sprintf("%s/%s/%s - %s", $1, $2, $3, $4)
+       name = gensub(/-/, " ", "g", $4)
+       string = sprintf("%s/%s/%s - %s", $1, $2, $3, name)
 
        printf("\t<div id=\"post-list-item\"><a href=\"/posts/%s.html\">%s</a></div>\n", file, string)
 }