8000 feat(search): allow filtering contents in search sections by farnabaz Β· Pull Request #3053 Β· nuxt/content Β· GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(search): allow filtering contents in search sections #3053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/runtime/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function queryCollectionItemSurroundings<T extends keyof PageCollections>
return chainablePromise(collection, qb => generateItemSurround(qb, path, opts))
}

export async function queryCollectionSearchSections(collection: keyof Collections, opts?: { ignoredTags: string[] }) {
return generateSearchSections(queryCollection(collection), opts)
export function queryCollectionSearchSections(collection: keyof Collections, opts?: { ignoredTags: string[] }) {
return chainablePromise(collection, qb => generateSearchSections(qb, opts))
}

async function executeContentQuery<T extends keyof Collections, Result = Collections[T]>(event: H3Event, collection: T, sql: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function queryCollectionItemSurroundingsWithEvent<T extends keyof PageCol
return chainablePromise(event, collection, qb => generateItemSurround(qb, path, opts))
}

export async function queryCollectionSearchSections(event: H3Event, collection: keyof Collections, opts?: { ignoredTags: string[] }) {
return generateSearchSections(queryCollectionWithEvent(event, collection), opts)
export function queryCollectionSearchSections(event: H3Event, collection: keyof Collections, opts?: { ignoredTags: string[] }) {
return chainablePromise(event, collection, qb => generateSearchSections(qb, opts))
}

function chainablePromise<T extends keyof PageCollections, Result>(event: H3Event, collection: T, fn: (qb: CollectionQueryBuilder<PageCollections[T]>) => Promise<Result>) {
Expand Down
0