mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
update: optimize the ordering of top posts and tags
This commit is contained in:
parent
4fc12b804c
commit
0402ac4c09
14 changed files with 48 additions and 67 deletions
|
@ -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()
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue