mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
🚀 refactor: redesign the layout, reduce page size, and significantly improve build speed
This commit is contained in:
parent
89e1359bb5
commit
51ae238192
18 changed files with 390 additions and 486 deletions
|
@ -3,11 +3,8 @@ import Layout from '@/layouts/Layout.astro'
|
|||
---
|
||||
|
||||
<Layout>
|
||||
|
||||
<!-- Decorative line -->
|
||||
<div class="uno-decorative-line"></div>
|
||||
|
||||
<!-- 404 -->
|
||||
<h1 class="mt-10 text-8 font-title">404</h1>
|
||||
|
||||
</Layout>
|
||||
|
|
|
@ -38,13 +38,10 @@ const { Content } = aboutEntry ? await aboutEntry.render() : { Content: null }
|
|||
---
|
||||
|
||||
<Layout>
|
||||
|
||||
<!-- Decorative line -->
|
||||
<div class="uno-decorative-line"></div>
|
||||
|
||||
<!-- About page content -->
|
||||
<div class="heti">
|
||||
{Content && <Content />}
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
|
|
|
@ -35,23 +35,18 @@ const pinnedPosts = await getPinnedPosts(lang)
|
|||
const postsByYear = await getPostsByYear(lang)
|
||||
---
|
||||
<Layout>
|
||||
<main>
|
||||
|
||||
<!-- Pinned Posts -->
|
||||
{pinnedPosts.length > 0 && (
|
||||
<section class="mb-7.5 lg:mb-10">
|
||||
<div class="uno-decorative-line"></div>
|
||||
<PostList posts={pinnedPosts} lang={lang} />
|
||||
</section>
|
||||
)}
|
||||
|
||||
<!-- Regular Posts -->
|
||||
{[...postsByYear.entries()].map(([_year, posts]) => (
|
||||
<section class="mb-7.5 lg:mb-10">
|
||||
<div class="uno-decorative-line"></div>
|
||||
<PostList posts={posts} lang={lang} />
|
||||
</section>
|
||||
))}
|
||||
|
||||
</main>
|
||||
<!-- Pinned Posts -->
|
||||
{pinnedPosts.length > 0 && (
|
||||
<section class="mb-7.5 lg:mb-10">
|
||||
<div class="uno-decorative-line"></div>
|
||||
<PostList posts={pinnedPosts} lang={lang} />
|
||||
</section>
|
||||
)}
|
||||
<!-- Regular Posts -->
|
||||
{[...postsByYear.entries()].map(([_year, posts]) => (
|
||||
<section class="mb-7.5 lg:mb-10">
|
||||
<div class="uno-decorative-line"></div>
|
||||
<PostList posts={posts} lang={lang} />
|
||||
</section>
|
||||
))}
|
||||
</Layout>
|
||||
|
|
|
@ -107,10 +107,8 @@ const { Content, remarkPluginFrontmatter } = await post.render()
|
|||
>
|
||||
<article class="heti mb-12.6">
|
||||
<div class="relative">
|
||||
|
||||
<!-- Desktop back home button -->
|
||||
<BackHome />
|
||||
|
||||
<!-- Title -->
|
||||
<h1 class="post-title">
|
||||
<span
|
||||
|
@ -134,7 +132,6 @@ const { Content, remarkPluginFrontmatter } = await post.render()
|
|||
minutes={remarkPluginFrontmatter.minutes}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<Content />
|
||||
</article>
|
||||
|
@ -153,8 +150,6 @@ const { Content, remarkPluginFrontmatter } = await post.render()
|
|||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<!-- Comments -->
|
||||
<Comments />
|
||||
|
||||
</Layout>
|
||||
|
|
|
@ -34,10 +34,8 @@ const allTags = await getAllTags(lang)
|
|||
---
|
||||
|
||||
<Layout>
|
||||
|
||||
<!-- Decorative line -->
|
||||
<div class="uno-decorative-line"></div>
|
||||
|
||||
<!-- Tags list -->
|
||||
<div class="uno-tags-wrapper">
|
||||
{allTags.map(tag => (
|
||||
|
@ -49,5 +47,4 @@ const allTags = await getAllTags(lang)
|
|||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
|
|
|
@ -53,10 +53,8 @@ const supportedLangs = tagSupportedLangs.filter(Boolean) as string[]
|
|||
---
|
||||
|
||||
<Layout supportedLangs={supportedLangs}>
|
||||
|
||||
<!-- Decorative line -->
|
||||
<div class="uno-decorative-line"></div>
|
||||
|
||||
<!-- Tags list -->
|
||||
<div class="uno-tags-wrapper">
|
||||
{allTags.map(tagName => (
|
||||
|
@ -77,5 +75,4 @@ const supportedLangs = tagSupportedLangs.filter(Boolean) as string[]
|
|||
<div class="mt-10.5">
|
||||
<PostList posts={posts} lang={lang} />
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue