mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
feat: i18n rss url and different excerpt length for different languages
This commit is contained in:
parent
e4c61bf21b
commit
f34b0cb46b
6 changed files with 62 additions and 13 deletions
|
@ -98,7 +98,7 @@ export async function getStaticPaths() {
|
|||
}
|
||||
|
||||
const { post, lang, supportedLangs } = Astro.props
|
||||
const description = generateDescription(post)
|
||||
const description = generateDescription(post, 'meta')
|
||||
const { Content, remarkPluginFrontmatter } = await post.render()
|
||||
|
||||
// 构建标签链接
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import type { CollectionEntry } from 'astro:content'
|
||||
import { generateDescription } from '@/utils/description'
|
||||
import { OGImageRoute } from 'astro-og-canvas'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
@ -7,11 +8,11 @@ const blogEntries = await getCollection('posts')
|
|||
|
||||
// Convert to page data objects
|
||||
const pages = Object.fromEntries(
|
||||
blogEntries.map(post => [
|
||||
blogEntries.map((post: CollectionEntry<'posts'>) => [
|
||||
post.slug,
|
||||
{
|
||||
title: post.data.title,
|
||||
description: post.data.description || generateDescription(post),
|
||||
description: post.data.description || generateDescription(post, 'og'),
|
||||
},
|
||||
]),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue