fix: open graph on home page

pull/307/head
北雁 Cryolitia 2024-04-12 07:54:09 +08:00
parent 071c65e935
commit d674fd4791
No known key found for this signature in database
GPG Key ID: 3E5D1772FC8A8EDD
2 changed files with 7 additions and 3 deletions

View File

@ -110,7 +110,7 @@ export default defineConfig({
'meta', 'meta',
{ {
name: 'description', name: 'description',
content: '跨性别和多元性别人群健康照护指南第八版SOC-8', content: siteDescription,
}, },
]) ])
@ -168,6 +168,10 @@ export default defineConfig({
if (pageSourceFileContent.length > 100) if (pageSourceFileContent.length > 100)
pageContent += '...' pageContent += '...'
if (context.pageData.frontmatter?.layout === 'home') {
pageContent = context.pageData.frontmatter?.hero?.tagline ?? siteDescription
}
head.push([ head.push([
'meta', 'meta',
{ name: 'description', content: pageContent }, { name: 'description', content: pageContent },

View File

@ -5,7 +5,7 @@ layout: home
hero: hero:
name: "RLE.wiki" name: "RLE.wiki"
text: "一份 RLE 指北" text: "一份 RLE 指北"
tagline: 欢迎大家来到 RLE.wiki. 这是一份给跨性别者们的 RLE 指南。部分内容由 MtF.wiki 迁移而来,更多帮助正在路上,敬请期待。 tagline: 欢迎大家来到 RLE.wiki. 这是一份给跨性别者与性别多元群体的 RLE 指南。更多帮助正在路上,敬请期待……
actions: actions:
- theme: brand - theme: brand
text: 大学指南 🏫 text: 大学指南 🏫
@ -33,7 +33,7 @@ import HomeContent from './.vitepress/theme/components/HomeContent.vue'
::: :::
::: tip ::: tip
本项目的内容包括且不仅限于校园指南,后期会加入其他 RLE 指导。当前处于建设初期,其他条目暂未完成,欢迎大家帮助项目完善。 网站当前处于建设初期,条目暂未完成,欢迎大家帮助项目完善。
::: :::
::: info 🕯️ ::: info 🕯️