From e337e046a1ea0bc67829f326cc50dad7cc9a9ae7 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Sat, 28 Dec 2024 00:29:13 +0100 Subject: [PATCH] (search) hide spoiler content of sources --- server/api/search.get.ts | 12 ++++++++++-- src/search.ts | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/server/api/search.get.ts b/server/api/search.get.ts index e45201a61..834583678 100644 --- a/server/api/search.get.ts +++ b/server/api/search.get.ts @@ -42,7 +42,7 @@ interface LoadedSearchKind { } const DEFAULT_OPTIONS: Options = { - fields: ['title', 'titleSmall', 'content'], + fields: ['title', 'titleSmall', 'content', 'contentHidden'], storeFields: ['kind'], }; @@ -132,6 +132,7 @@ const transformResult = (indices: Map 0 @@ -495,6 +502,7 @@ const kinds: SearchKind[] = [ title, image: image ? { src: image } : undefined, content, + contentHidden, }; }); }, diff --git a/src/search.ts b/src/search.ts index e597c3900..a98193634 100644 --- a/src/search.ts +++ b/src/search.ts @@ -12,6 +12,7 @@ export interface SearchDocument { titleSmall?: string | undefined; image?: SearchDocumentImage | undefined; content: string; + contentHidden?: string; date?: string; authors?: string[]; }