Skip to content

Commit

Permalink
feat(theme): support categories and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Dec 29, 2023
1 parent ea2729c commit ad8aba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/theme/src/node/compact/frontmatter.ts
Expand Up @@ -6,8 +6,6 @@ import { logger } from "../utils.js";

const DEPRECATED_FRONTMATTER_OPTIONS: [string, string][] = [
["authors", "author"],
["categories", "category"],
["tags", "tag"],
["time", "date"],
["visitor", "pageview"],
["sidebarDepth", "headerDepth"],
Expand Down
3 changes: 3 additions & 0 deletions packages/theme/src/node/plugins/blog/info.ts
Expand Up @@ -43,9 +43,12 @@ export const injectBlogBasicInfo = (
// resolve category
if ("category" in frontmatter)
info[ArticleInfoType.category] = frontmatter.category;
else if ("categories" in frontmatter)
info[ArticleInfoType.category] = frontmatter.categories;

// resolve tag
if ("tag" in frontmatter) info[ArticleInfoType.tag] = frontmatter.tag;
else if ("tags" in frontmatter) info[ArticleInfoType.tag] = frontmatter.tags;

// resolve sticky
if ("sticky" in frontmatter)
Expand Down

0 comments on commit ad8aba2

Please sign in to comment.