refactor: enhance theme configuration and path handling

- Update config.ts with more descriptive comments and simplified settings
- Remove about page content section
- Add new path utility functions for localization and page type detection
- Introduce SiteTitle component for mobile post page navigation
- Modify Header and Layout components to use new path utilities
- Adjust title spacing and font sizes
- Update VSCode settings with new dictionary words
This commit is contained in:
radishzzz 2025-02-04 18:56:34 +00:00
parent 35b2542ec8
commit f8bf077948
8 changed files with 130 additions and 93 deletions

View file

@ -1,25 +1,29 @@
---
import themeConfig from '@/config'
import { getPagePath } from '@/utils/path'
const { title, subtitle } = themeConfig.site
const { titleSpace } = themeConfig.global
const currentPath = Astro.url.pathname
const { getLocalizedPath } = getPagePath(currentPath)
const marginBottom = {
1: 'mb-1',
2: 'mb-2',
3: 'mb-3',
4: 'mb-4',
2: 'mb-3',
3: 'mb-5',
}[titleSpace] || 'mb-3'
---
<header>
<h1 class={`${marginBottom} mt--5.2 text-12 c-primary font-bold font-title`}>
<a href="/">
<h1 class={`${marginBottom} mt--5 text-12.8 c-primary font-bold font-title`}>
<a href={getLocalizedPath('/')}>
{title}
</a>
</h1>
<h2 class="text-5.6 c-secondary font-navbar">
{subtitle}
</h2>
{subtitle && (
<h2 class="text-5.6 c-secondary font-navbar">
{subtitle}
</h2>
)}
</header>