feat: add language as post property (#151)

* feat: add language as post property

* update frontmatter.json

* style: remove extra space

* fix: remove unnecessary replacements

* feat: add `language` field to `new-post.js`

* style: format code style

* fix: use `siteConfig.lang` in `jsonLd`

* fix: use `siteConfig` when `entry.data` was empty
This commit is contained in:
Alan Ye
2024-08-27 23:52:30 +08:00
committed by GitHub
parent 856c2bb2c0
commit f79ee3482d
6 changed files with 20 additions and 6 deletions
+3 -2
View File
@@ -11,15 +11,16 @@ interface Props {
title?: string
banner?: string
description?: string
lang?: string
}
const { title, banner, description } = Astro.props
const { title, banner, description, lang } = Astro.props
const hasBannerCredit =
siteConfig.banner.enable && siteConfig.banner.credit.enable
const hasBannerLink = !!siteConfig.banner.credit.url
---
<Layout title={title} banner={banner} description={description}>
<Layout title={title} banner={banner} description={description} lang={lang}>
<slot slot="head" name="head"></slot>
<div class="max-w-[var(--page-width)] min-h-screen grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto]
mx-auto gap-4 relative px-0 md:px-4"