mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
✨ feat: complete language switching functionality and centralized page routing
This commit is contained in:
parent
4651828dd1
commit
05d3a8034b
26 changed files with 253 additions and 146 deletions
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import Waline from '@/components/Comments/Waline.astro'
|
||||
import { generateMultiLangPostPaths } from '@/i18n/route'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { checkSlugDuplication } from '@/utils/content'
|
||||
import { generateDescription } from '@/utils/description'
|
||||
import { generateMultiLangPostPaths } from '@/utils/i18n/route'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
|
@ -17,7 +17,7 @@ export async function getStaticPaths() {
|
|||
return generateMultiLangPostPaths(posts)
|
||||
}
|
||||
|
||||
const { post } = Astro.props
|
||||
const { post, supportedLangs = [] } = Astro.props
|
||||
const description = generateDescription(post)
|
||||
const { Content, remarkPluginFrontmatter } = await post.render()
|
||||
---
|
||||
|
@ -26,6 +26,7 @@ const { Content, remarkPluginFrontmatter } = await post.render()
|
|||
postTitle={post.data.title}
|
||||
postDescription={description}
|
||||
postSlug={post.slug}
|
||||
supportedLangs={supportedLangs}
|
||||
>
|
||||
<article>
|
||||
<h1>{post.data.title}</h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue