update: optimize the ordering of top posts and tags

This commit is contained in:
radishzzz 2025-03-10 00:39:44 +00:00
parent 4fc12b804c
commit 0402ac4c09
14 changed files with 48 additions and 67 deletions

View file

@ -1,7 +1,7 @@
---
import PostTitleList from '@/components/PostTitleList.astro'
import Layout from '@/layouts/Layout.astro'
import { getPinnedPosts, getPostsByYear } from '@/utils/content'
import PostTitleList from '@/components/PostTitleList.astro'
const pinnedPosts = await getPinnedPosts()
const postsByYear = await getPostsByYear()

View file

@ -43,9 +43,14 @@ const { Content, remarkPluginFrontmatter } = await post.render()
<time>
{post.data.published.toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')}
</time>
<span class="ml-1.25">
<span class="ml-1.5">
{remarkPluginFrontmatter.minutes} min
</span>
{post.data.updated && (
<span class="ml-1.5">
updated {post.data.updated.toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')}
</span>
)}
</div>
<Content />
</article>

View file

@ -1,7 +1,7 @@
---
import PostTitleList from '@/components/PostTitleList.astro'
import Layout from '@/layouts/Layout.astro'
import { getAllTags, getPostsByTag } from '@/utils/content'
import PostTitleList from '@/components/PostTitleList.astro'
export async function getStaticPaths() {
const tags = await getAllTags()
@ -24,8 +24,8 @@ const allTags = await getAllTags()
href={`/tags/${tag}/`}
class={`uno-tags-style ${
Astro.props.tag === tag
? "uno-tag-active"
: ""
? 'uno-tag-active'
: ''
}`}
>
{tag}