Capitalize tag names to completely avoid ambiguity issues

This commit is contained in:
PrinOrange
2024-01-06 16:37:43 +08:00
parent e4c370ede5
commit fb308f7b11

View File

@@ -45,7 +45,7 @@ const sortOutPostLists = async (): Promise<{
for (let i = 0; i < postFilePaths.length; i++) {
const frontmatter = await getFrontmatters(postFilePaths[i]);
const postId = path.parse(postFilePaths[i]).name;
const capitalizedTags = frontmatter.tags?.map((tagname) => capitalizeFirstLetter(tagname));
const normalizedTags = frontmatter.tags?.map((tagname) => tagname.toUpperCase());
const postListItem: TPostListItem = {
id: postId,
@@ -53,7 +53,7 @@ const sortOutPostLists = async (): Promise<{
title: frontmatter.title,
subtitle: nullifyEmptyString(frontmatter.subtitle),
coverURL: nullifyEmptyString(frontmatter.coverURL),
tags: capitalizedTags ?? [],
tags: normalizedTags ?? [],
summary: nullifyEmptyString(frontmatter.summary),
time: frontmatter.time,
pin: frontmatter.pin ?? false,