diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/page/homepage.js | 1 | ||||
-rw-r--r-- | src/strings-default.json | 2 | ||||
-rwxr-xr-x | src/upd8.js | 9 |
3 files changed, 11 insertions, 1 deletions
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') })}> <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')} |