From e2cce321fc8509e3932eb7457963feefd3d38264 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Sun, 16 Feb 2025 01:10:06 +0000 Subject: [PATCH] update: post page layout --- package.json | 1 + pnpm-lock.yaml | 3 ++ src/components/MobileHeader.astro | 46 +++++++++++++++++++++---------- src/layouts/Layout.astro | 2 +- src/pages/index.astro | 11 +++++--- src/pages/posts/[slug].astro | 20 ++++++++------ src/styles/heti.css | 7 +++-- 7 files changed, 61 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 722cf4b..adf36d7 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "@types/node": "^22.13.4", "@types/sanitize-html": "^2.13.0", "@unocss/eslint-plugin": "^65.5.0", + "@unocss/preset-attributify": "^65.5.0", "@unocss/reset": "^65.5.0", "astro-eslint-parser": "^1.2.1", "eslint": "^9.20.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d03b12..8732744 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,6 +111,9 @@ importers: '@unocss/eslint-plugin': specifier: ^65.5.0 version: 65.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@unocss/preset-attributify': + specifier: ^65.5.0 + version: 65.5.0 '@unocss/reset': specifier: ^65.5.0 version: 65.5.0 diff --git a/src/components/MobileHeader.astro b/src/components/MobileHeader.astro index 79dd915..37138d4 100644 --- a/src/components/MobileHeader.astro +++ b/src/components/MobileHeader.astro @@ -2,25 +2,43 @@ import themeConfig from '@/config' import { getPagePath } from '@/utils/path' -const { title } = themeConfig.site +const { title, subtitle } = themeConfig.site +const { titleSpace } = themeConfig.global const currentPath = Astro.url.pathname const { getLocalizedPath } = getPagePath(currentPath) + +const marginBottom = { + 1: 'mb-2.6', + 2: 'mb-4.6', + 3: 'mb-6.6', + }[titleSpace] || 'mb-4.6' --- -
- - + + + {subtitle && ( + + )}