From c4d11bebb50f1ac2f07a06732b12f6d471bd1bf0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 17 Nov 2024 14:21:05 -0400 Subject: content: generatePageLayout: showWikiName: 'auto' --- src/content/dependencies/generatePageLayout.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js index cc8bc777..ec1b3156 100644 --- a/src/content/dependencies/generatePageLayout.js +++ b/src/content/dependencies/generatePageLayout.js @@ -70,8 +70,8 @@ export default { }, showWikiNameInTitle: { - type: 'boolean', - default: true, + validate: v => v.is(true, false, 'auto'), + default: 'auto', }, subtitle: { @@ -631,7 +631,14 @@ export default { workingOptions.subtitle = slots.subtitle; } - if (slots.showWikiNameInTitle) { + const showWikiName = + (slots.showWikiNameInTitle === true + ? true + : slots.showWikiNameInTitle === 'auto' + ? html.isBlank(slots.subtitle) + : false); + + if (showWikiName) { workingCapsule += '.withWikiName'; workingOptions.wikiName = data.wikiName; } -- cgit 1.3.0-6-gf8a5