From 3b542d286f66e54cb10507fb196a61b7b2f1ee94 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 22 May 2022 10:47:12 -0300 Subject: wiki short name in page/tab title --- src/page/homepage.js | 1 + src/strings-default.json | 2 ++ src/upd8.js | 9 ++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/page/homepage.js b/src/page/homepage.js index b20fc812..534ce78b 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -29,6 +29,7 @@ export function writeTargetless({wikiData}) { transformMultiline }) => ({ title: wikiInfo.name, + showWikiNameInTitle: false, meta: { description: wikiInfo.description diff --git a/src/strings-default.json b/src/strings-default.json index f1a53027..9ece6a8e 100644 --- a/src/strings-default.json +++ b/src/strings-default.json @@ -151,6 +151,8 @@ "misc.nav.next": "Next", "misc.nav.info": "Info", "misc.nav.gallery": "Gallery", + "misc.pageTitle": "{TITLE}", + "misc.pageTitle.withWikiName": "{TITLE} | {WIKI_NAME}", "misc.skippers.skipToContent": "Skip to content", "misc.skippers.skipToSidebar": "Skip to sidebar", "misc.skippers.skipToSidebar.left": "Skip to sidebar (left)", diff --git a/src/upd8.js b/src/upd8.js index 63d36b0a..394af80e 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') })}> - ${title} + ${(showWikiNameInTitle + ? language.formatString('misc.pageTitle.withWikiName', { + title, + wikiName: wikiInfo.nameShort + }) + : language.formatString('misc.pageTitle', {title}))} ${Object.entries(meta).filter(([ key, value ]) => value).map(([ key, value ]) => ``).join('\n')} -- cgit 1.3.0-6-gf8a5