mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
refactor: restructure project configuration and utility modules
- Move configuration and utility files to more organized locations - Update import paths across the project to reflect new file structure - Simplify content and internationalization utilities - Remove redundant configuration files and consolidate logic - Add prefetch configuration to Astro config for improved performance
This commit is contained in:
parent
a26031d490
commit
fc1daf4335
23 changed files with 380 additions and 393 deletions
|
@ -1,22 +1,18 @@
|
|||
---
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { checkSlugDuplication } from '@/utils/content.config'
|
||||
import { checkSlugDuplication } from '@/utils/content'
|
||||
import { generatePostPaths } from '@/utils/i18n'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('posts')
|
||||
|
||||
|
||||
const duplicates = await checkSlugDuplication(posts)
|
||||
if (duplicates.length > 0) {
|
||||
throw new Error(`Slug conflicts found:\n${duplicates.join('\n')}`)
|
||||
}
|
||||
|
||||
return posts.map(post => ({
|
||||
params: {
|
||||
slug: post.data.slug || post.slug,
|
||||
},
|
||||
props: { post },
|
||||
}))
|
||||
return generatePostPaths(posts)
|
||||
}
|
||||
|
||||
const { post } = Astro.props
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue