feat(content): new blog post
This commit is contained in:
parent
8e6df747e0
commit
28bd68c09e
17 changed files with 118 additions and 40 deletions
|
@ -4,9 +4,9 @@ import { Badge } from '@/components/ui/badge'
|
|||
import { Separator } from '@/components/ui/separator'
|
||||
import { parseAuthors } from '@/lib/server-utils'
|
||||
import { formatDate, readingTime } from '@/lib/utils'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { Image } from 'astro:assets'
|
||||
import type { CollectionEntry } from 'astro:content'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import Link from './Link.astro'
|
||||
|
||||
type Props = {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Icon } from 'astro-icon/components'
|
|||
const { prevPost, nextPost } = Astro.props
|
||||
---
|
||||
|
||||
<div class="col-start-2 grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div class="col-start-2 grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<Link
|
||||
href={nextPost ? `/blog/${nextPost.id}` : '#'}
|
||||
class={cn(
|
||||
|
|
|
@ -43,9 +43,7 @@ const { project } = Astro.props
|
|||
project.data.tags && (
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{project.data.tags.map((tag: string) => (
|
||||
<Badge variant="secondary">
|
||||
{tag}
|
||||
</Badge>
|
||||
<Badge variant="secondary">{tag}</Badge>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -140,7 +140,7 @@ const PaginationComponent: React.FC<PaginationProps> = ({
|
|||
<Pagination>
|
||||
<PaginationContent className="flex-wrap">
|
||||
<PaginationItem>
|
||||
<PaginationPrevious
|
||||
<PaginationPrevious
|
||||
href={currentPage > 1 ? getPageUrl(currentPage - 1) : undefined}
|
||||
isDisabled={currentPage === 1}
|
||||
/>
|
||||
|
@ -148,7 +148,7 @@ const PaginationComponent: React.FC<PaginationProps> = ({
|
|||
|
||||
{pages.map((page) => (
|
||||
<PaginationItem key={page}>
|
||||
<PaginationLink
|
||||
<PaginationLink
|
||||
href={getPageUrl(page)}
|
||||
isActive={page === currentPage}
|
||||
>
|
||||
|
@ -165,7 +165,9 @@ const PaginationComponent: React.FC<PaginationProps> = ({
|
|||
|
||||
<PaginationItem>
|
||||
<PaginationNext
|
||||
href={currentPage < totalPages ? getPageUrl(currentPage + 1) : undefined}
|
||||
href={
|
||||
currentPage < totalPages ? getPageUrl(currentPage + 1) : undefined
|
||||
}
|
||||
isDisabled={currentPage === totalPages}
|
||||
/>
|
||||
</PaginationItem>
|
||||
|
@ -182,7 +184,6 @@ interface PaginationProps {
|
|||
|
||||
export default PaginationComponent
|
||||
|
||||
|
||||
export {
|
||||
Pagination,
|
||||
PaginationContent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue