diff --git a/README.md b/README.md index 71e27a7..2665862 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Fuwari (not the final name maybe) is a static blog template built with [Astro](h - [x] **Built with [Astro](https://astro.build) and [Tailwind CSS](https://tailwindcss.com)** - [x] **View Transitions between pages** - - [Haven't supported by Firefox and Safari yet](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility) + - [is not supported by Firefox and Safari yet](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility) - [x] Light / dark mode - [x] Customizable theme colors & banner - [x] Responsive design @@ -34,7 +34,8 @@ title: My First Blog Post published: 2023-09-09 description: This is the first post of my new Astro blog. image: /images/cover.jpg -tags: ['Foo', 'Bar'] +tags: [Foo, Bar] +category: Front-end --- ``` diff --git a/scripts/new-post.js b/scripts/new-post.js index 1915b38..4e185e6 100644 --- a/scripts/new-post.js +++ b/scripts/new-post.js @@ -39,9 +39,9 @@ const content = title: ${args[0]} published: ${getDate()} description: -image: +image: tags: [] -categories: [] +category: --- `; diff --git a/src/components/PostMetadata.astro b/src/components/PostMetadata.astro index 7068dad..edb0690 100644 --- a/src/components/PostMetadata.astro +++ b/src/components/PostMetadata.astro @@ -9,6 +9,7 @@ interface Props { published: Date; tags: string[]; categories: string[]; + category: string; } const {published, tags, categories} = Astro.props; const className = Astro.props.class; diff --git a/src/components/TitleCardNew.astro b/src/components/TitleCardNew.astro index e9d400e..2d317d6 100644 --- a/src/components/TitleCardNew.astro +++ b/src/components/TitleCardNew.astro @@ -8,11 +8,12 @@ interface Props { published: Date; tags: string[]; categories: string[]; + category: string; image: string; description: string; words: number; } -const { entry, title, url, published, tags, categories, image, description, words } = Astro.props; +const { entry, title, url, published, tags, categories, category, image, description, words } = Astro.props; const className = Astro.props.class; // console.log(Astro.props); import ImageBox from "./misc/ImageBox.astro"; @@ -28,6 +29,11 @@ const coverWidth = "28%"; const { remarkPluginFrontmatter } = await entry.render(); +let cate = categories; +if (category) { + cate = [category]; +} + ---