mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
chore: add toc theme config option and update theme guides
This commit is contained in:
parent
94f9998f45
commit
eb82a7d2f2
14 changed files with 121 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
|||
import { glob } from 'astro/loaders'
|
||||
import { defineCollection, z } from 'astro:content'
|
||||
import { allLocales } from '@/config'
|
||||
import { allLocales, themeConfig } from '@/config'
|
||||
|
||||
const posts = defineCollection({
|
||||
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/posts' }),
|
||||
|
@ -15,7 +15,7 @@ const posts = defineCollection({
|
|||
// Advanced
|
||||
draft: z.boolean().optional().default(false),
|
||||
pin: z.number().int().min(0).max(99).optional().default(0),
|
||||
toc: z.boolean().optional().default(true),
|
||||
toc: z.boolean().optional().default(themeConfig.global.toc),
|
||||
lang: z.enum(['', ...allLocales]).optional().default(''),
|
||||
abbrlink: z.string().optional().default('').refine(
|
||||
abbrlink => !abbrlink || /^[a-z0-9\-]*$/.test(abbrlink),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue