diff --git a/src/components/Button.astro b/src/components/Button.astro index 948977c..e9534a6 100644 --- a/src/components/Button.astro +++ b/src/components/Button.astro @@ -1,5 +1,5 @@ --- -import { moreLocales } from '@/config' +import { moreLocales, themeConfig } from '@/config' import { getNextGlobalLangPath, getNextSupportedLangPath } from '@/i18n/path' import { isPostPage, isTagPage } from '@/utils/page' @@ -7,6 +7,8 @@ interface Props { supportedLangs: string[] } +const { light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color + const { supportedLangs } = Astro.props const currentPath = Astro.url.pathname const isPost = isPostPage(currentPath) @@ -25,10 +27,10 @@ const nextUrl = useSupportedLangs ---
@@ -64,4 +66,57 @@ class:list={[ -
\ No newline at end of file + + + + diff --git a/src/components/Header.astro b/src/components/Header.astro index 84dd33f..a6e8653 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -39,13 +39,19 @@ const SubtitleTag = isPost ? 'div' : 'h2' 'font-bold font-title', ]} > - +
- {headerTitle} + + {headerTitle} +
{headerSubtitle && ( diff --git a/src/components/Widgets/BackHome.astro b/src/components/Widgets/BackHome.astro index a411b1e..acf725c 100644 --- a/src/components/Widgets/BackHome.astro +++ b/src/components/Widgets/BackHome.astro @@ -13,3 +13,22 @@ + + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index e1cbde6..2660f00 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,8 +1,8 @@ --- +import Button from '@/components/Button.astro' import Footer from '@/components/Footer.astro' import Header from '@/components/Header.astro' import Navbar from '@/components/Navbar.astro' -import Button from '@/components/Button.astro' import themeConfig from '@/config' import Head from '@/layouts/Head.astro' import { getPageInfo } from '@/utils/page' @@ -18,9 +18,7 @@ interface Props { } const { postTitle, postDescription, postSlug, supportedLangs = [] } = Astro.props -const { getLocalizedPath, isPost } = getPageInfo(Astro.url.pathname) -const localizedHome = getLocalizedPath('/') -const { light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color +const { isPost } = getPageInfo(Astro.url.pathname) const fontStyle = themeConfig.global.fontStyle === 'serif' ? 'font-serif' : 'font-sans' const MarginBottom = isPost && themeConfig.comment?.enabled ? 'mb-10' // Post page with comment system @@ -45,81 +43,8 @@ const MarginBottom = isPost && themeConfig.comment?.enabled
-