From 0341a4ed36c4aef507784dc6ceb1862b2e1dd8d6 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 23 May 2023 12:14:21 +0800 Subject: [PATCH] fix: use labels names as tags in the front matter --- src/settings/template.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/settings/template.ts b/src/settings/template.ts index 4bb285c..51d3572 100644 --- a/src/settings/template.ts +++ b/src/settings/template.ts @@ -218,11 +218,7 @@ export const renderArticleContnet = async ( siteName, originalUrl: article.originalArticleUrl, author: article.author, - labels: article.labels?.map((l) => { - return { - name: l.name.replaceAll(" ", "_"), - }; - }), + labels: renderLabels(article.labels), dateSaved, highlights, content: article.content, @@ -255,7 +251,8 @@ export const renderArticleContnet = async ( break; case "tags": if (articleView.labels && articleView.labels.length > 0) { - frontMatter[item] = articleView.labels; + // use label names as tags + frontMatter[item] = articleView.labels.map((l) => l.name); } break; case "date_saved":