From f4672181aa5e1f8a1eb3c35cfd6d617eeb416d6e Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 26 Mar 2022 17:31:50 +0000 Subject: [PATCH] Pass through excerpts to the frontend --- quickpeep/src/web/searcher.rs | 4 ++-- quickpeep/templates/search.html.askama | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/quickpeep/src/web/searcher.rs b/quickpeep/src/web/searcher.rs index 4885cd9..73b1357 100644 --- a/quickpeep/src/web/searcher.rs +++ b/quickpeep/src/web/searcher.rs @@ -19,7 +19,7 @@ pub struct SearchResult { pub favicon_url: String, pub url: String, pub title: String, - pub excerpt: Vec, + pub excerpt: String, pub tags: Vec, } @@ -70,7 +70,7 @@ pub async fn search_search_inner( favicon_url: "".to_string(), url: search_doc.url, title: search_doc.title, - excerpt: vec![], // TODO + excerpt: search_doc.excerpt, tags: vec!["Software".to_owned(), "Blog".to_owned()], // TODO }) } diff --git a/quickpeep/templates/search.html.askama b/quickpeep/templates/search.html.askama index d201d50..27fac7e 100644 --- a/quickpeep/templates/search.html.askama +++ b/quickpeep/templates/search.html.askama @@ -29,13 +29,7 @@
- {%- for excerpt_chunk in result.excerpt -%} - {%- if excerpt_chunk.mark %} - {{ excerpt_chunk.text }} - {%- else %} - {{ excerpt_chunk.text }} - {%- endif -%} - {%- endfor -%} + {{- result.excerpt -}}
    {%- for tag in result.tags -%}