fix comments
This commit is contained in:
1 parent
a311ef72d3
commit
8960aa88bd
4 files changed
+9
-8
No files matched your search
@@ -22,7 +22,7 @@ const PostPage = (post: IPost) => {
|
||||
window.remark42Instance = window.REMARK42.createInstance({
|
||||
node: remark42Ref.current,
|
||||
host: THEME.comment.remark42.host,
|
||||
site_id: THEME.comment.remark42.siteId
|
||||
site_id: THEME.comment.remark42.site_id
|
||||
})
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
|
||||
return {
|
||||
paths: dbPost.find().map(({ path }) => ({
|
||||
params: { path: path.split(/\//g).map(encodeURIComponent) }
|
||||
params: { path: path.split(/\//g) }
|
||||
})),
|
||||
fallback: false
|
||||
}
|
||||
@@ -108,7 +108,7 @@ export const getStaticProps: GetStaticProps = async (ctx) => {
|
||||
|
||||
return {
|
||||
props: dbPost.findOne({
|
||||
path: (ctx.params.path as string[]).map(decodeURIComponent).join('/')
|
||||
path: (ctx.params.path as string[]).join('/')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ async function main () {
|
||||
await fs.writeFile(
|
||||
buildPath('theme.json'),
|
||||
JSON.stringify(
|
||||
yaml.safeLoad(await fs.readFile(srcPath(THEME_FILENAME), 'utf8'))
|
||||
yaml.load(await fs.readFile(srcPath(THEME_FILENAME), 'utf8'))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ async function main () {
|
||||
await Promise.all(
|
||||
files.map(async (f) => {
|
||||
const header = zMatter.parse(
|
||||
yaml.safeLoad(
|
||||
yaml.load(
|
||||
fs.readFileSync(srcPath('_post', f), 'utf-8').split(/\n---\n/)[0]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -47,8 +47,9 @@ export const zTheme = z
|
||||
remark42: z
|
||||
.object({
|
||||
host: z.string(),
|
||||
siteId: z.string()
|
||||
site_id: z.string()
|
||||
})
|
||||
.nonstrict()
|
||||
.optional()
|
||||
})
|
||||
.optional()
|
||||
@@ -59,6 +60,6 @@ export type ITheme = z.infer<typeof zTheme>
|
||||
|
||||
export function getTheme () {
|
||||
return zTheme.parse(
|
||||
yaml.safeLoad(fs.readFileSync(buildPath(THEME_FILENAME), 'utf-8'))
|
||||
yaml.load(fs.readFileSync(buildPath(THEME_FILENAME), 'utf-8'))
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user