🚀 refactor: redesign the layout, reduce page size, and significantly improve build speed

This commit is contained in:
radishzzz 2025-03-22 03:45:15 +00:00
parent 89e1359bb5
commit 51ae238192
18 changed files with 390 additions and 486 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>