fix: fix homepage meta settings
This commit is contained in:
parent
3bd4752bfd
commit
9d3d1537e8
3 changed files with 5 additions and 24 deletions
|
|
@ -63,11 +63,6 @@ export const zh = {
|
|||
],
|
||||
},
|
||||
pageMeta: {
|
||||
home: {
|
||||
title: "小孙同学",
|
||||
description: "读书、摄影、编程、旅行,热爱可抵岁月漫长~",
|
||||
ogImage: "/preview.png",
|
||||
},
|
||||
archive: {
|
||||
title: "归档",
|
||||
description: "小孙同学的所有文章",
|
||||
|
|
@ -105,11 +100,6 @@ export const en = {
|
|||
],
|
||||
},
|
||||
pageMeta: {
|
||||
home: {
|
||||
title: "Guoqi Sun",
|
||||
description: "Reading, Photography, Programming, Traveling",
|
||||
ogImage: "/preview.png",
|
||||
},
|
||||
archive: {
|
||||
title: "All Posts",
|
||||
description: "Here are Guoqi Sun's all posts",
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@ const config = lang === "zh" ? zh : en
|
|||
<link rel="icon" type="image/svg+xml" href={config.meta.favicon} />
|
||||
<title>
|
||||
{
|
||||
!title
|
||||
? `${config.meta.title} - ${config.meta.slogan}`
|
||||
: `${config.meta.title} - ${title}`
|
||||
title
|
||||
? `${config.meta.title} - ${title}`
|
||||
: `${config.meta.title} - ${config.meta.slogan}`
|
||||
}
|
||||
</title>
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<meta
|
||||
name="description"
|
||||
content={!description ? config.meta.description : description}
|
||||
content={description ? description : config.meta.description}
|
||||
/>
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
|
|
|
|||
|
|
@ -2,24 +2,15 @@
|
|||
import Footer from "~/components/astro/footer.astro"
|
||||
import Intro from "~/components/astro/intro.astro"
|
||||
import RecentBlogs from "~/components/astro/recent-blogs.astro"
|
||||
import { en, zh } from "~/config"
|
||||
import { getLangFromUrl } from "~/i18n/utils"
|
||||
import MainLayout from "~/layouts/main.astro"
|
||||
import { getLanguagePaths } from "~/utils/langs"
|
||||
|
||||
export function getStaticPaths() {
|
||||
return getLanguagePaths()
|
||||
}
|
||||
|
||||
const lang = getLangFromUrl(Astro.url)
|
||||
const pageMeta = lang === "zh" ? zh.pageMeta : en.pageMeta
|
||||
---
|
||||
|
||||
<MainLayout
|
||||
title={pageMeta.home.title}
|
||||
description={pageMeta.home.description}
|
||||
ogImage={pageMeta.home.ogImage}
|
||||
>
|
||||
<MainLayout ogImage="/preview.png">
|
||||
<Intro />
|
||||
<RecentBlogs />
|
||||
<Footer />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue