From 4a224b58f482fb22e20360539dfad86ba6405ca9 Mon Sep 17 00:00:00 2001 From: xy <10816187@qq.com> Date: Sat, 15 Aug 2026 22:23:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BD=92=E6=A1=A3=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/IndexPage.astro | 60 +--------- src/components/Post/List.astro | 6 + src/consts.ts | 3 +- src/layouts/Layout.astro | 21 +++- src/layouts/PageFooter.astro | 26 ++++ src/{components => layouts}/PageHeader.astro | 24 ++-- src/pages/archive.astro | 119 +++++++++++++++++++ src/pages/post/[...slug].astro | 68 +++-------- src/pages/sitemap-pages.xml.ts | 1 + src/styles/css-reset.css | 4 + 10 files changed, 215 insertions(+), 117 deletions(-) create mode 100644 src/layouts/PageFooter.astro rename src/{components => layouts}/PageHeader.astro (62%) diff --git a/src/components/IndexPage.astro b/src/components/IndexPage.astro index 328855f..7b2682e 100644 --- a/src/components/IndexPage.astro +++ b/src/components/IndexPage.astro @@ -1,11 +1,7 @@ --- -import {siteConfig} from "@/consts.ts"; import PostList from "@/components/Post/List.astro"; import Pagination from "@/components/Post/Pagination.astro"; import type {Post} from "@/types"; -import PageHeader from "@/components/PageHeader.astro"; - -const {siteTitle} = siteConfig; interface Props { posts: Post[] @@ -15,42 +11,18 @@ interface Props { const {posts, page, totalPage} = Astro.props --- - -
- - +

did you stand too close to the fire?
like a liar looking for forgiveness from a stone.

-
- - -
+ + +
- -
diff --git a/src/components/Post/List.astro b/src/components/Post/List.astro index 6ebe24a..03b6481 100644 --- a/src/components/Post/List.astro +++ b/src/components/Post/List.astro @@ -67,4 +67,10 @@ const {posts} = Astro.props .post:hover .arrow { color: #334155; } + + @media (max-width: 640px) { + .post .d { + min-width: 64px; + } + } diff --git a/src/consts.ts b/src/consts.ts index 85cf289..8a47c1b 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -2,5 +2,6 @@ export const siteConfig = { site: "https://ua42.com", siteTitle: "Uroboros", postPageSize: 7, - description: "Uroboros is a blog about programming, technology, and life." + description: "一个人的自留地 ,不欢迎我,也不欢迎你。", + git: "https://git.ua42.com" } diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index cce1a1e..974e2fd 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,6 +1,9 @@ --- import "@/styles/global.css"; import {siteConfig} from "@/consts.ts"; +import PageHeader from "./PageHeader.astro"; +import PageFooter from "./PageFooter.astro"; + const {siteTitle} = siteConfig; interface Props { @@ -28,7 +31,11 @@ const pageTitle = title ? `${title} - ${siteTitle}` : siteTitle;
- + +
+ +
+
@@ -39,11 +46,19 @@ const pageTitle = title ? `${title} - ${siteTitle}` : siteTitle; } .container { + width: 100%; max-width: var(--layout-width); - margin: 0 auto; - padding: 24px; height: 100%; min-height: 100%; + margin: 0 auto; + padding: 24px; + display: flex; + flex-direction: column; + } + + main { + flex: 1; + padding: 24px 0; } @media (max-width: 640px) { diff --git a/src/layouts/PageFooter.astro b/src/layouts/PageFooter.astro new file mode 100644 index 0000000..0c30f38 --- /dev/null +++ b/src/layouts/PageFooter.astro @@ -0,0 +1,26 @@ + + + diff --git a/src/components/PageHeader.astro b/src/layouts/PageHeader.astro similarity index 62% rename from src/components/PageHeader.astro rename to src/layouts/PageHeader.astro index 173ea1e..104e5d9 100644 --- a/src/components/PageHeader.astro +++ b/src/layouts/PageHeader.astro @@ -1,17 +1,14 @@ --- import {siteConfig} from "@/consts.ts"; -const {siteTitle} = siteConfig; +const {siteTitle,git} = siteConfig; ---

{siteTitle}

- - - - - - - +
diff --git a/src/pages/post/[...slug].astro b/src/pages/post/[...slug].astro index 02aebd3..2156e12 100644 --- a/src/pages/post/[...slug].astro +++ b/src/pages/post/[...slug].astro @@ -4,7 +4,6 @@ import "@/styles/github-markdown-reset.css"; import "photoswipe/dist/photoswipe.css"; import Layout from '@/layouts/Layout.astro'; -import PageHeader from '@/components/PageHeader.astro'; import {createHttp} from "@/lib/request.ts"; import type {Post} from "@/types"; import {processHtmlWithJsdom} from "@/lib/processHtml.ts"; @@ -30,51 +29,34 @@ const content = await processHtmlWithJsdom(data.content); const published_at = formatDatetime(data.published_at, "YYYY.MM.DD"); --- - -
- - -
-
-
- {data.category_name} · {data.category_code.toUpperCase()} - {published_at} -
- -
{data.view_count} 次阅读
+ +
+
+
+ {data.category_name} · {data.category_code.toUpperCase()} + {published_at}
-

{data.title}

-

{data.summary}

+
{data.view_count} 次阅读
+
+

{data.title}

-
+

{data.summary}

-
+
- { - data.tags.length > 0 && -
- {data.tags.map(tag => {tag.name})} -
- } -
+
-
-
© {siteTitle}
-
-
+ { + data.tags.length > 0 && +
+ {data.tags.map(tag => {tag.name})} +
+ } +