Skip to content

Commit

Permalink
fix: use labels names as tags in the front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhb committed May 23, 2023
1 parent e27b80f commit 0341a4e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/settings/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 0341a4e

Please sign in to comment.