site

My personal website.

Date: Wed, 14 Jul 2021 14:15:49 +0200

Make generated html links have a .html extension

Diffstat:

M generate                            |       4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

@@ -59,7 +59,7 @@ function join(array, start, end, sep,    result, i) {
     if (text == "")
         text = url;
     if (html) {
-        sub(/\.gmi$/, "", url);
+        sub(/\.gmi$/, ".html", url);
         print "<p><a href=\"" url "\">" $0 "</a></p>";
     } else {
         split(url, segments, "/");
@@ -206,7 +206,7 @@ cp -rf ./* "$dir"
 files="$(find "$dir" -name '*.gmi')"
 
 while read -r file <&4; do
-    awk "$program" "$file" > "$(printf "%s" "$file" | sed "s/\.gmi/.$extension/")"
+    awk "$program" "$file" > "$(printf "%s" "$file" | sed "s/\.gmi$/.$extension/")"
 done 4<< EOF
 $files
 EOF