Skip to content

Commit

Permalink
feat!: front-matter language -> lang
Browse files Browse the repository at this point in the history
  • Loading branch information
saicaca committed Sep 9, 2024
1 parent 1399bd9 commit 31af084
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/new-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ image: ''
tags: []
category: ''
draft: false
language: ''
lang: ''
---
`

Expand Down
2 changes: 1 addition & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const postsCollection = defineCollection({
image: z.string().optional().default(''),
tags: z.array(z.string()).optional().default([]),
category: z.string().optional().default(''),
language: z.string().optional().default(''),
lang: z.string().optional().default(''),

/* For internal use */
prevTitle: z.string().default(''),
Expand Down
4 changes: 2 additions & 2 deletions src/pages/posts/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const jsonLd = {
url: Astro.site,
},
datePublished: formatDateToYYYYMMDD(entry.data.published),
inLanguage: (entry.data.language ? entry.data.language.replace('_', '-') : siteConfig.lang.replace('_', '-')),
inLanguage: (entry.data.lang ? entry.data.lang.replace('_', '-') : siteConfig.lang.replace('_', '-')),
// TODO include cover image here
}
---
<MainGridLayout banner={entry.data.image} title={entry.data.title} description={entry.data.description} lang={entry.data.language}>
<MainGridLayout banner={entry.data.image} title={entry.data.title} description={entry.data.description} lang={entry.data.lang}>
<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 ",
Expand Down

0 comments on commit 31af084

Please sign in to comment.