Skip to content

Commit 95f714f

Browse files
committed
chore: comments
1 parent 2bf5cb7 commit 95f714f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/runtime/server/api/navigation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { isPreview } from '../preview'
88
export default defineEventHandler(async (event) => {
99
const query = getContentQuery(event)
1010

11+
// Read from cache if not preview and there is no query
1112
if (!isPreview(event) && Object.keys(query).length === 0) {
1213
const cache = cacheStorage.getItem('content-navigation.json')
1314
if (cache) {

src/runtime/server/content-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function getIndexedContentsList<T = ParsedContent> (event: Compatib
2424
const params = query.params()
2525
const path = params?.where?.find(wh => wh._path)?._path
2626

27-
// Index is available for string and RegExp paths
27+
// Read from Index is not preview and path is string or RegExp
2828
if (!isPreview(event) && (typeof path === 'string' || path instanceof RegExp)) {
2929
const index = await getContentIndex(event)
3030
const keys = Object.keys(index)

0 commit comments

Comments
 (0)