perf(theme): improve auto-frontmatter cache (#222)
This commit is contained in:
parent
117522969e
commit
fe3945ccc3
@ -92,7 +92,12 @@ export async function generateAutoFrontmatter(app: App) {
|
||||
|
||||
const cachePath = app.dir.cache(CACHE_FILE)
|
||||
if (fs.existsSync(cachePath)) {
|
||||
generate.cache = JSON.parse(await fs.readFile(cachePath, 'utf-8'))
|
||||
try {
|
||||
generate.cache = JSON.parse(await fs.readFile(cachePath, 'utf-8'))
|
||||
}
|
||||
catch {
|
||||
generate.cache = {}
|
||||
}
|
||||
}
|
||||
const markdownList = await readMarkdownList(app, generate)
|
||||
await promiseParallel(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user