diff --git a/frontmatter.json b/frontmatter.json index a377ad99e..ac17e0af8 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -46,11 +46,6 @@ "name": "tags", "type": "list" }, - { - "title": "category", - "name": "category", - "type": "string" - }, { "title": "draft", "name": "draft", diff --git a/scripts/new-post.js b/scripts/new-post.js index 187bfd0e7..9e99e7dc4 100644 --- a/scripts/new-post.js +++ b/scripts/new-post.js @@ -51,7 +51,7 @@ published: ${getDate()} description: '' image: '' tags: [] -category: '' + draft: false lang: '' --- diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index 24159c8c5..0fb37d498 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -1,16 +1,13 @@ --- -import { UNCATEGORIZED } from "@constants/constants"; -import I18nKey from "../i18n/i18nKey"; -import { i18n } from "../i18n/translation"; + import { getSortedPosts } from "../utils/content-utils"; import { getPostUrlBySlug } from "../utils/url-utils"; interface Props { keyword?: string; tags?: string[]; - categories?: string[]; } -const { tags, categories } = Astro.props; +const { tags } = Astro.props; let posts = await getSortedPosts(); @@ -22,13 +19,7 @@ if (Array.isArray(tags) && tags.length > 0) { ); } -if (Array.isArray(categories) && categories.length > 0) { - posts = posts.filter( - (post) => - (post.data.category && categories.includes(post.data.category)) || - (!post.data.category && categories.includes(UNCATEGORIZED)), - ); -} + const groups: { year: number; posts: typeof posts }[] = (() => { const groupedPosts = posts.reduce( @@ -74,7 +65,7 @@ function formatTag(tag: string[]) {