+theme_attachments(){
+ local page="$1" title
+ title="${page%/}"; title="${title##*/}"
+
+ # Important! Web Server response including newline
+ printf "%s\r\n" "Content-Type: text/html; charset=utf-8" ""
+
+ cat <<-EOF
+ <!DOCTYPE HTML>
+ <html><head>
+ $(theme_head)
+ <title>Attachments $(HTML "${title}")</title>
+ </head><body id="$(HTML "$page")[attachment]/">
+ $(theme_header)
+ <main>
+ <ul class="attachment list">
+ $(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
+ [ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \
+ -a -f "$_DATA/pages/$page/#attachments/${file##*/}" ] && continue
+ stat="$(stat -c '%s %Y' -- "$file" 2>&-)" || continue
+ size="${stat% *}" date="${stat#* }"
+
+ printf '<li><span class=name>%s</span>
+ <span class=size>%s</span><span class=date>%s</span></li>' \
+ "$(HTML "${file##*/}")" "$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
+ done)
+ </ul>
+ </main>
+ $(theme_footer)
+ </body></html>
+ EOF
+}
+