Skip to content

Commit

Permalink
chore(remove): category and draft functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
gaomingzhao666 committed Oct 26, 2024
1 parent d420e57 commit dae4db2
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 321 deletions.
22 changes: 0 additions & 22 deletions src/components/Category.astro

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/ListCategories.astro

This file was deleted.

4 changes: 1 addition & 3 deletions src/components/PostCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ArrowUp from '@/components/icons/ArrowUp'
const {
id,
data: { title, description, pubDate, heroImage, category },
data: { title, description, pubDate, heroImage },
readTime,
slug
} = Astro.props
Expand All @@ -29,8 +29,6 @@ const {
<FormattedDate date={pubDate} />
<span class='text-sm'> {readTime}</span>
</div>

<span class='pb-4'>{category}</span>
</div>
</div>
</a>
Expand Down
194 changes: 0 additions & 194 deletions src/content/blog/astro copy 2.mdx

This file was deleted.

7 changes: 3 additions & 4 deletions src/content/blog/astro copy 3.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: 'Astro Components'
title: 'tesdt'
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non dia'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/images/te.jpg'
category: 'Category 2'
tags: ['JavaScript', 'css', 'HTML5', 'GitHub']
heroImage: '../../assets/images/book.jpg'
tags: ['tets']
---

**If you know HTML, you already know enough to write your first Astro component.**
Expand Down
3 changes: 1 addition & 2 deletions src/content/blog/astro copy 4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: 'Components'
description: 'Astro components are HTML templates with superpowers. They are a superset of HTML, with support for including components and JavaScript expressions.'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/images/banner.jpg'
category: 'Category 3'
heroImage: '../../assets/images/book.jpg'
tags: ['JavaScript', 'css', 'HTML5', 'GitHub', 'Ordenador']
---

Expand Down
3 changes: 1 addition & 2 deletions src/content/blog/create-astro-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: 'Tutorial: Create an Astro Component'
description: 'Learn how to create your first Astro component.'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/images/placeholder-hero.jpg'
category: 'Category 1'
heroImage: '../../assets/images/book.jpg'
tags: ['JavaScript', 'css', 'HTML5', 'GitHub']
---

Expand Down
1 change: 0 additions & 1 deletion src/content/blog/macbook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: 'MacBook'
description: 'The new MacBook Pro 2022 is here. With the Apple M2 chip, a new design, and more, the new MacBook Pro is the best laptop Apple has ever made.'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/images/book.jpg'
category: 'Category 4'
tags: ['PC']
---

Expand Down
3 changes: 0 additions & 3 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineCollection, z } from 'astro:content'
import { CATEGORIES } from '@/data/categories'

const blog = defineCollection({
// Type-check frontmatter using a schema
Expand All @@ -13,9 +12,7 @@ const blog = defineCollection({
.or(z.date())
.transform((val) => new Date(val)),
heroImage: image(),
category: z.enum(CATEGORIES),
tags: z.array(z.string()),
draft: z.boolean().default(false)
})
})

Expand Down
8 changes: 0 additions & 8 deletions src/data/categories.ts

This file was deleted.

40 changes: 0 additions & 40 deletions src/pages/category/[category]/[page].astro

This file was deleted.

3 changes: 1 addition & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
import ListCategories from '@/components/ListCategories'
import ListPosts from '@/components/ListPosts'
import TitlePage from '@/components/TitlePage'
import BaseLayout from '@/layouts/BaseLayout'
Expand All @@ -11,7 +10,7 @@ const posts = await getPosts(MAX_POSTS)

<BaseLayout title='Home'>
<TitlePage title='Blog Title' />
<ListCategories />
<hr>

<div>
<h2 class='text-lg font-medium tracking-wide text-end'>Latest Posts</h2>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/ja/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
import ListCategories from '@/components/ListCategories'
import ListPosts from '@/components/ListPosts'
import TitlePage from '@/components/TitlePage'
import BaseLayout from '@/layouts/BaseLayout'
Expand All @@ -11,7 +10,6 @@ const posts = await getPosts(MAX_POSTS)

<BaseLayout title='Home'>
<TitlePage title='Blogs' />
<ListCategories />

<div>
<h2 class='text-lg font-medium tracking-wide text-end'>Latest Posts</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { sluglify, unsluglify } from './sluglify'
export { cn } from './cn'
export { getCategories, getPosts, getTags, getPostByTag, filterPostsByCategory } from './post'
export { getPosts, getTags, getPostByTag } from './post'
export { remarkReadingTime } from './readTime'
Loading

0 comments on commit dae4db2

Please sign in to comment.