« get me outta code hell

wiki short name in page/tab title - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/upd8.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-22 10:47:12 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-22 10:47:12 -0300
commit3b542d286f66e54cb10507fb196a61b7b2f1ee94 (patch)
tree56b41222616beea55d1cb15278e3d07de987b08a /src/upd8.js
parent5f2d40478a5e50031db3a3cb48f39f6b1e2b9ef5 (diff)
wiki short name in page/tab title data-restructure
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-xsrc/upd8.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 63d36b0..394af80 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -848,6 +848,8 @@ writePage.html = (pageInfo, {
         theme = '',
         stylesheet = '',
 
+        showWikiNameInTitle = true,
+
         // missing properties are auto-filled, see below!
         body = {},
         banner = {},
@@ -1086,7 +1088,12 @@ writePage.html = (pageInfo, {
             'data-rebase-data': to('data.root')
         })}>
             <head>
-                <title>${title}</title>
+                <title>${(showWikiNameInTitle
+                    ? language.formatString('misc.pageTitle.withWikiName', {
+                        title,
+                        wikiName: wikiInfo.nameShort
+                    })
+                    : language.formatString('misc.pageTitle', {title}))}</title>
                 <meta charset="utf-8">
                 <meta name="viewport" content="width=device-width, initial-scale=1">
                 ${Object.entries(meta).filter(([ key, value ]) => value).map(([ key, value ]) => `<meta ${key}="${html.escapeAttributeValue(value)}">`).join('\n')}