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({
|
window.remark42Instance = window.REMARK42.createInstance({
|
||||||
node: remark42Ref.current,
|
node: remark42Ref.current,
|
||||||
host: THEME.comment.remark42.host,
|
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 {
|
return {
|
||||||
paths: dbPost.find().map(({ path }) => ({
|
paths: dbPost.find().map(({ path }) => ({
|
||||||
params: { path: path.split(/\//g).map(encodeURIComponent) }
|
params: { path: path.split(/\//g) }
|
||||||
})),
|
})),
|
||||||
fallback: false
|
fallback: false
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ export const getStaticProps: GetStaticProps = async (ctx) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
props: dbPost.findOne({
|
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(
|
await fs.writeFile(
|
||||||
buildPath('theme.json'),
|
buildPath('theme.json'),
|
||||||
JSON.stringify(
|
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(
|
await Promise.all(
|
||||||
files.map(async (f) => {
|
files.map(async (f) => {
|
||||||
const header = zMatter.parse(
|
const header = zMatter.parse(
|
||||||
yaml.safeLoad(
|
yaml.load(
|
||||||
fs.readFileSync(srcPath('_post', f), 'utf-8').split(/\n---\n/)[0]
|
fs.readFileSync(srcPath('_post', f), 'utf-8').split(/\n---\n/)[0]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -47,8 +47,9 @@ export const zTheme = z
|
|||||||
remark42: z
|
remark42: z
|
||||||
.object({
|
.object({
|
||||||
host: z.string(),
|
host: z.string(),
|
||||||
siteId: z.string()
|
site_id: z.string()
|
||||||
})
|
})
|
||||||
|
.nonstrict()
|
||||||
.optional()
|
.optional()
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
@@ -59,6 +60,6 @@ export type ITheme = z.infer<typeof zTheme>
|
|||||||
|
|
||||||
export function getTheme () {
|
export function getTheme () {
|
||||||
return zTheme.parse(
|
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