From ce07403ebf2fa3757f06fc4e989ef45e84c1eae1 Mon Sep 17 00:00:00 2001 From: JJAYCHEN <31304335+JJAYCHEN1e@users.noreply.github.com> Date: Sun, 7 May 2023 00:46:30 +0800 Subject: [PATCH] feat: Add a default style for built-in property "tags". --- src/main.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.ts b/src/main.ts index 35215ef..752a991 100644 --- a/src/main.ts +++ b/src/main.ts @@ -107,6 +107,17 @@ async function main() { let value = ""; if (propertyName in properties) { value = properties[propertyName] + if (propertyName === "tags" && formatTemplate === undefined) { + const htmlTemplate = '#${pageName}' + const separatorSpanTemplate = ' ' + if (Array.isArray(value)) { + value = `
${value.map((tag) => { + return htmlTemplate.replaceAll("${pageName}", tag) + }).join(separatorSpanTemplate)}
` + } else { + value = htmlTemplate.replaceAll("${pageName}", value) + } + } template = template.replace(`$${propertyName}`, value) } console.info(propertyName, template)