mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 14:52:52 +01:00
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:
@@ -11,7 +11,7 @@ import { Icon } from 'astro-icon/components'
|
||||
import { licenseConfig } from 'src/config'
|
||||
import PostMetadata from '../../components/PostMeta.astro'
|
||||
import ImageWrapper from '../../components/misc/ImageWrapper.astro'
|
||||
import { profileConfig } from '../../config'
|
||||
import { profileConfig, siteConfig } from '../../config'
|
||||
import { formatDateToYYYYMMDD } from '../../utils/date-utils'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
@@ -41,10 +41,11 @@ const jsonLd = {
|
||||
url: Astro.site,
|
||||
},
|
||||
datePublished: formatDateToYYYYMMDD(entry.data.published),
|
||||
inLanguage: (entry.data.language ? entry.data.language.replace('_', '-') : siteConfig.lang.replace('_', '-')),
|
||||
// TODO include cover image here
|
||||
}
|
||||
---
|
||||
<MainGridLayout banner={entry.data.image} title={entry.data.title} description={entry.data.description}>
|
||||
<MainGridLayout banner={entry.data.image} title={entry.data.title} description={entry.data.description} lang={entry.data.language}>
|
||||
<script is:inline slot="head" type="application/ld+json" set:html={JSON.stringify(jsonLd)}></script>
|
||||
<div class="flex w-full rounded-[var(--radius-large)] overflow-hidden relative mb-4">
|
||||
<div id="post-container" class:list={["card-base z-10 px-6 md:px-9 pt-6 pb-4 relative w-full ",
|
||||
|
||||
Reference in New Issue
Block a user