-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
481976d
commit 28c6b4d
Showing
16 changed files
with
104 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h1 class='text-5xl font-semibold -tracking-wide first-letter:uppercase'> | ||
<slot /> | ||
</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
import Title from './Title.astro' | ||
import Shape from './icons/Shape.astro' | ||
type Props = { | ||
title: string | ||
} | ||
const { title } = Astro.props | ||
--- | ||
|
||
<div class='flex justify-start items-center gap-2 title'> | ||
<Shape /> | ||
<Title>{title}</Title> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
import BaseLayout from '@/layouts/BaseLayout' | ||
import ListPosts from '@/components/ListPosts' | ||
import TitlePage from '@/components/TitlePage' | ||
import { getTags, getPostByTag } from '@/utils' | ||
export async function getStaticPaths() { | ||
const tags = await getTags() | ||
return tags.map((tag) => ({ | ||
params: { tag }, | ||
props: { tag } | ||
})) | ||
} | ||
const { tag } = Astro.props | ||
const posts = await getPostByTag(tag) | ||
--- | ||
|
||
<BaseLayout title={tag}> | ||
<TitlePage title={tag} /> | ||
<ListPosts posts={posts} /> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
--- | ||
import BaseLayout from '@/layouts/BaseLayout' | ||
import TitlePage from '@/components/TitlePage' | ||
import { getTags } from '@/utils' | ||
const tags = await getTags() | ||
--- | ||
|
||
<BaseLayout title='Tags'>tags</BaseLayout> | ||
<BaseLayout title='Tags'> | ||
<TitlePage title='Tags' /> | ||
<div class='flex justify-center flex-wrap gap-4'> | ||
{ | ||
tags.map((tag) => ( | ||
<a | ||
href={`/tags/${tag}`} | ||
class='inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-2' | ||
> | ||
#{tag} | ||
</a> | ||
)) | ||
} | ||
</div> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } from './post' | ||
export { getCategories, getPosts, getTags, getPostByTag, filterPostsByCategory } from './post' | ||
export { remarkReadingTime } from './readTime' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters