添加 404,优化 RSS 排序🥭

This commit is contained in:
Han 2025-02-21 11:45:54 +08:00
parent 6cc85fe0d7
commit 5535b338b3
3 changed files with 24 additions and 1 deletions

19
src/pages/404.astro Normal file
View File

@ -0,0 +1,19 @@
---
// 公共 Layout
import Layout from "../layouts/Layout.astro";
// Aside组件
import Aside from "../components/Aside.astro";
// 文章页面样式
import "../styles/Article.less";
---
<Layout title="404 Not Found" keywords={[404]} description="404 Not Found">
<section class="vh-container">
<article class="vh-animation vh-article-main">
<header>
<h1 class="error-title">404 Not Found</h1>
</header>
</article>
<Aside />
</section>
</Layout>

View File

@ -16,6 +16,6 @@ export async function GET(context: any) {
pubDate: post.data.updated || post.data.date,
description: getDescription(post),
link: `/article/${post.data.id}`
})).reverse(),
})).sort((a: any, b: any) => (new Date(b.pubDate).getTime() - new Date(a.pubDate).getTime())),
});
}

View File

@ -38,6 +38,10 @@ section.vh-container {
padding-bottom: 1rem;
font-size: 1.58rem;
&.error-title {
font-size: 1.88rem;
}
&::before {
display: none;
}