blog/src/components/Header.astro
radishzzz bdc2aa32e6 refactor: enhance site navigation and styling
- Add view transitions for site title
- Update Navbar with hover effects and improved typography
- Modify index page layout with decorative lines and date formatting
- Adjust post publication dates
- Update VSCode dictionary with new terms
2025-02-04 22:32:15 +00:00

32 lines
668 B
Text

---
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-3',
3: 'mb-5',
}[titleSpace] || 'mb-3'
---
<header>
<h1 class={`${marginBottom} mt--5 text-12.8 c-primary font-bold font-title`}>
<a
href={getLocalizedPath('/')}
transition:name="site-title"
>
{title}
</a>
</h1>
{subtitle && (
<h2 class="text-5.6 c-secondary font-navbar">
{subtitle}
</h2>
)}
</header>