add awsm theme
This commit is contained in:
1 parent
7039b10df2
commit
e397c9ae1e
15 files changed
+117
-115
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
import yaml from 'js-yaml'
|
||||
import * as z from 'zod'
|
||||
@@ -8,6 +9,7 @@ export const THEME_FILENAME = 'theme.yml'
|
||||
export const zTheme = z
|
||||
.object({
|
||||
title: z.string(),
|
||||
awsm: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
keywords: z.array(z.string()).optional(),
|
||||
nav: z
|
||||
@@ -50,6 +52,10 @@ export const zTheme = z
|
||||
})
|
||||
.nonstrict()
|
||||
|
||||
export type ITheme = z.infer<typeof zTheme>
|
||||
|
||||
export function getTheme() {
|
||||
return zTheme.parse(yaml.safeLoad(fs.readFileSync(THEME_FILENAME, 'utf-8')))
|
||||
return zTheme.parse(
|
||||
yaml.safeLoad(fs.readFileSync(path.join('built', THEME_FILENAME), 'utf-8'))
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user