« get me outta code hell

content, css: transformContent: show filename in audio embeds - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-21 13:24:12 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-21 13:24:12 -0300
commit4336906d8f8ea4cbae07d24c7813453ae16c9980 (patch)
tree9b384fd8fe48daa951f3392caeef744d8d53f514 /src/content
parent01eb1d00e45dc2c8ca508e250a2d753aee0c4b5d (diff)
content, css: transformContent: show filename in audio embeds
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/transformContent.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index c1415474..fcdc3aa4 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -1,3 +1,5 @@
+import {basename} from 'node:path';
+
 import {bindFind} from '#find';
 import {replacerSpec, parseContentNodes} from '#replacer';
 
@@ -483,7 +485,13 @@ export default {
                     align === 'center' &&
                       {class: 'align-center'},
 
-                    audio));
+                    [
+                      html.tag('a', {class: 'filename'},
+                        src && {href: src},
+                        language.sanitize(basename(node.src))),
+
+                      audio,
+                    ]));
 
             return {
               type: 'processed-audio',