« get me outta code hell

expose URL key and value(s) in html - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-23 12:33:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-23 12:33:57 -0300
commitfdb149f9404cd29567689ee4196bbd408c9507cc (patch)
tree5b9050677e1e12d64d0ad19621fe10905574f54f
parent3ba2440f7b405b0f2556957ad827defe25873c4d (diff)
expose URL key and value(s) in html
-rwxr-xr-xsrc/upd8.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 4d51d7f7..ba59068f 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -1082,7 +1082,10 @@ writePage.html = (pageInfo, {
     return filterEmptyLines(fixWS`
         <!DOCTYPE html>
         <html ${html.attributes({
-            lang: language.code,
+            lang: language.intlCode,
+            'data-language-code': language.code,
+            'data-url-key': paths.toPath[0],
+            ...Object.fromEntries(paths.toPath.slice(1).map((v, i) => [['data-url-value' + i], v])),
             'data-rebase-localized': to('localized.root'),
             'data-rebase-shared': to('shared.root'),
             'data-rebase-media': to('media.root'),