mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 02:31:33 +08:00
fix: ts lint
This commit is contained in:
@ -31,18 +31,18 @@ const directProjects = [
|
||||
url: 'https://greasyfork.org/zh-CN/users/904256-kazoottt-wang',
|
||||
imagePath: '/src/assets/greasyFork.png',
|
||||
altText: 'greasyFork'
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
// Get projects from markdown
|
||||
const mdProjects = allPosts
|
||||
.filter(post => post.data.category === '项目-已结项')
|
||||
.filter((post) => post.data.category === '项目-已结项')
|
||||
.sort((a, b) => {
|
||||
if (a.data.pinned && !b.data.pinned) return -1
|
||||
if (!a.data.pinned && b.data.pinned) return 1
|
||||
return new Date(b.data.date).getTime() - new Date(a.data.date).getTime()
|
||||
})
|
||||
.map(post => ({
|
||||
.map((post) => ({
|
||||
title: post.data.title,
|
||||
description: post.data.description || '',
|
||||
url: post.data.projectUrl ? post.data.projectUrl : `/posts/${post.slug}`,
|
||||
@ -53,7 +53,6 @@ const mdProjects = allPosts
|
||||
|
||||
// Combine both types of projects
|
||||
const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
||||
|
||||
---
|
||||
|
||||
<PageLayout meta={{ title: 'Home' }}>
|
||||
@ -178,25 +177,27 @@ const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
||||
</Section>
|
||||
|
||||
<Section title='Projects' subtitle='(open source)'>
|
||||
<div class='grid grid-cols-1 sm:grid-cols-2 gap-3'>
|
||||
{projects.map((project) => (
|
||||
<ProjectCard
|
||||
href={project.url}
|
||||
heading={project.title}
|
||||
subheading={project.description}
|
||||
imagePath={project.imagePath}
|
||||
altText={project.altText}
|
||||
target={project.isExternal ? '_blank' : undefined}
|
||||
/>
|
||||
))}
|
||||
<div class='grid grid-cols-1 gap-3 sm:grid-cols-2'>
|
||||
{
|
||||
projects.map((project) => (
|
||||
<ProjectCard
|
||||
href={project.url}
|
||||
heading={project.title}
|
||||
subheading={project.description}
|
||||
imagePath={project.imagePath}
|
||||
altText={project.altText}
|
||||
target={'_blank'}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<a
|
||||
<div class='mt-4 flex justify-end'>
|
||||
<a
|
||||
href={`/categories/${encodeURIComponent('项目-已结项')}`}
|
||||
class="text-sm text-muted-foreground hover:text-foreground transition-colors flex items-center gap-x-1"
|
||||
class='flex items-center gap-x-1 text-sm text-muted-foreground transition-colors hover:text-foreground'
|
||||
>
|
||||
查看更多项目
|
||||
<Icon name="link" class="w-4 h-4" />
|
||||
<Icon name='link' class='h-4 w-4' />
|
||||
</a>
|
||||
</div>
|
||||
</Section>
|
||||
|
Reference in New Issue
Block a user