]> git.plutz.net Git - shellwiki/commitdiff
link to attached files
authorPaul Hänsch <paul@plutz.net>
Wed, 18 May 2022 20:30:57 +0000 (22:30 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 18 May 2022 20:30:57 +0000 (22:30 +0200)
macros/attachments

index aecacfb7397e5b9e17c1d9c9e660d6ba4d37ca86..bcd6722117985cf06bab8a0575755e2381fcb876 100755 (executable)
@@ -20,9 +20,10 @@ for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments
   stat="$(stat -c '%s %Y' -- "$file" 2>&-)" || continue
   size="${stat% *}" date="${stat#* }"
 
-  printf '<li><span class=name>%s</span>
+  printf '<li><a class=name href="[attachment]/%s">%s</a>
           <span class=size>%s</span><span class=date>%s</span></li>' \
-    "$(HTML "${file##*/}")" "$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
+    "$(HTML "${file##*/}")" "$(HTML "${file##*/}")" \
+    "$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
 done
 
 printf %s\\n '</ul>'