mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-24 03:01:31 +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',
|
url: 'https://greasyfork.org/zh-CN/users/904256-kazoottt-wang',
|
||||||
imagePath: '/src/assets/greasyFork.png',
|
imagePath: '/src/assets/greasyFork.png',
|
||||||
altText: 'greasyFork'
|
altText: 'greasyFork'
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
// Get projects from markdown
|
// Get projects from markdown
|
||||||
const mdProjects = allPosts
|
const mdProjects = allPosts
|
||||||
.filter(post => post.data.category === '项目-已结项')
|
.filter((post) => post.data.category === '项目-已结项')
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
if (a.data.pinned && !b.data.pinned) return -1
|
if (a.data.pinned && !b.data.pinned) return -1
|
||||||
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()
|
return new Date(b.data.date).getTime() - new Date(a.data.date).getTime()
|
||||||
})
|
})
|
||||||
.map(post => ({
|
.map((post) => ({
|
||||||
title: post.data.title,
|
title: post.data.title,
|
||||||
description: post.data.description || '',
|
description: post.data.description || '',
|
||||||
url: post.data.projectUrl ? post.data.projectUrl : `/posts/${post.slug}`,
|
url: post.data.projectUrl ? post.data.projectUrl : `/posts/${post.slug}`,
|
||||||
@ -53,7 +53,6 @@ const mdProjects = allPosts
|
|||||||
|
|
||||||
// Combine both types of projects
|
// Combine both types of projects
|
||||||
const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout meta={{ title: 'Home' }}>
|
<PageLayout meta={{ title: 'Home' }}>
|
||||||
@ -178,25 +177,27 @@ const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
|||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title='Projects' subtitle='(open source)'>
|
<Section title='Projects' subtitle='(open source)'>
|
||||||
<div class='grid grid-cols-1 sm:grid-cols-2 gap-3'>
|
<div class='grid grid-cols-1 gap-3 sm:grid-cols-2'>
|
||||||
{projects.map((project) => (
|
{
|
||||||
|
projects.map((project) => (
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
href={project.url}
|
href={project.url}
|
||||||
heading={project.title}
|
heading={project.title}
|
||||||
subheading={project.description}
|
subheading={project.description}
|
||||||
imagePath={project.imagePath}
|
imagePath={project.imagePath}
|
||||||
altText={project.altText}
|
altText={project.altText}
|
||||||
target={project.isExternal ? '_blank' : undefined}
|
target={'_blank'}
|
||||||
/>
|
/>
|
||||||
))}
|
))
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end mt-4">
|
<div class='mt-4 flex justify-end'>
|
||||||
<a
|
<a
|
||||||
href={`/categories/${encodeURIComponent('项目-已结项')}`}
|
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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
Reference in New Issue
Block a user