Pass through excerpts to the frontend
This commit is contained in:
parent
39ffdd1f1f
commit
f4672181aa
|
@ -19,7 +19,7 @@ pub struct SearchResult {
|
|||
pub favicon_url: String,
|
||||
pub url: String,
|
||||
pub title: String,
|
||||
pub excerpt: Vec<ExcerptFragment>,
|
||||
pub excerpt: String,
|
||||
pub tags: Vec<String>,
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
@ -29,13 +29,7 @@
|
|||
<img src="{{ result.favicon_url }}">
|
||||
<div class="result_title"><a href="{{ result.url }}" rel="nofollow noreferrer">{{ result.title }}</a></div>
|
||||
<div class="result_excerpt">
|
||||
{%- for excerpt_chunk in result.excerpt -%}
|
||||
{%- if excerpt_chunk.mark %}
|
||||
<b>{{ excerpt_chunk.text }}</b>
|
||||
{%- else %}
|
||||
{{ excerpt_chunk.text }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{{- result.excerpt -}}
|
||||
</div>
|
||||
<ul class="result_tags">
|
||||
{%- for tag in result.tags -%}
|
||||
|
|
Loading…
Reference in New Issue