mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
feat: automatically generate meta descriptions for articles
This commit is contained in:
parent
78de8b7911
commit
79f9765688
3 changed files with 51 additions and 10 deletions
|
@ -3,6 +3,7 @@ import Comments from '@/components/Comments/index.astro'
|
|||
import PostTime from '@/components/PostTime.astro'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { checkSlugDuplication } from '@/utils/content'
|
||||
import { generateDescription } from '@/utils/description'
|
||||
import { generatePostPaths } from '@/utils/i18n/route'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
|
@ -18,12 +19,13 @@ export async function getStaticPaths() {
|
|||
}
|
||||
|
||||
const { post } = Astro.props
|
||||
const description = generateDescription(post)
|
||||
const { Content, remarkPluginFrontmatter } = await post.render()
|
||||
---
|
||||
|
||||
<Layout
|
||||
postTitle={post.data.title}
|
||||
postDescription={post.data.description}
|
||||
postDescription={description}
|
||||
postImage={post.data.image}
|
||||
>
|
||||
<article class="heti mb-12.6">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue