mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-22 06:46:29 +01:00
feat(search): improve search index
This commit is contained in:
parent
ea655d9871
commit
26381b498d
4 changed files with 7 additions and 8 deletions
|
@ -29,7 +29,7 @@
|
||||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{- with $params.categories -}}
|
{{- with .Params.categories -}}
|
||||||
|
|
||||||
<span class="post-category">
|
<span class="post-category">
|
||||||
{{- T "included" -}}
|
{{- T "included" -}}
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
{{- /* Footer */ -}}
|
{{- /* Footer */ -}}
|
||||||
<div class="post-footer">
|
<div class="post-footer">
|
||||||
<a href="{{ .RelPermalink }}">{{ T "readMore" }}</a>
|
<a href="{{ .RelPermalink }}">{{ T "readMore" }}</a>
|
||||||
{{- with $params.tags -}}
|
{{- with .Params.tags -}}
|
||||||
<div class="post-tags">
|
<div class="post-tags">
|
||||||
<i class="fas fa-tags fa-fw"></i>
|
<i class="fas fa-tags fa-fw"></i>
|
||||||
{{- range $index, $value := . -}}
|
{{- range $index, $value := . -}}
|
||||||
|
|
|
@ -6,13 +6,12 @@
|
||||||
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}}
|
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- range $pages -}}
|
{{- range $pages -}}
|
||||||
{{- $params := .Params | merge $.Site.Params.page -}}
|
{{- $one := dict "objectID" .RelPermalink "uri" .RelPermalink "title" .Title "description" (.Description | default "") -}}
|
||||||
{{- $one := dict "uri" .RelPermalink "title" .Title "description" (.Description | default "") -}}
|
{{- $tags := .Params.tags | default slice -}}
|
||||||
{{- $tags := $params.tags | default slice -}}
|
|
||||||
{{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
|
{{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
|
||||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||||
{{- $one = dict "date" $publish_date | merge $one -}}
|
{{- $one = dict "date" $publish_date | merge $one -}}
|
||||||
{{- $content := dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | plainify -}}
|
{{- $content := .RawContent -}}
|
||||||
{{- if gt .Site.Params.search.contentLength 0 -}}
|
{{- if gt .Site.Params.search.contentLength 0 -}}
|
||||||
{{- $content = substr $content 0 .Site.Params.search.contentLength -}}
|
{{- $content = substr $content 0 .Site.Params.search.contentLength -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
<div class="post-info-more">
|
<div class="post-info-more">
|
||||||
<section class="post-tags">
|
<section class="post-tags">
|
||||||
{{- with $params.tags -}}
|
{{- with .Params.tags -}}
|
||||||
<i class="fas fa-tags fa-fw"></i>
|
<i class="fas fa-tags fa-fw"></i>
|
||||||
{{- range $index, $value := . -}}
|
{{- range $index, $value := . -}}
|
||||||
{{- if gt $index 0 }}, {{ end -}}
|
{{- if gt $index 0 }}, {{ end -}}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
{{- partial "plugin/link.html" $options -}}
|
{{- partial "plugin/link.html" $options -}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{- with $params.categories -}}
|
{{- with .Params.categories -}}
|
||||||
|
|
||||||
<span class="post-category">
|
<span class="post-category">
|
||||||
{{- T "included" -}}
|
{{- T "included" -}}
|
||||||
|
|
Loading…
Reference in a new issue