small fixes

This commit is contained in:
teldra 2022-06-22 18:36:10 +02:00
parent d653ebacd1
commit 3f1264d0f7
4 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
[ {{- $i := 0 -}}
{{- range where .Site.RegularPages "Section" "ne" "" -}}
{{- range where .Site.RegularPages "Section" "eq" "posts" -}}
{{- if not .Params.noSearch -}}
{{- if gt $i 0 }},{{ end -}}
{"date":"{{ .Date.Unix }}", "url":"{{ .Permalink }}", "title":{{ .Title | jsonify }}, "summary":{{ with .Description}}{{ . | plainify | jsonify }}{{ else }}{{ .Summary | plainify | jsonify }}{{ end }}, "content":{{ .Content | plainify | jsonify }},"tags":[ {{- $t := 0 }}{{- range .Param "tags" -}}{{ if gt $t 0 }},{{ end }}{{ . | jsonify }}{{ $t = add $t 1 }}{{ end -}} ], "section": {{ .Section | jsonify -}} }

View File

@ -48,7 +48,7 @@ let params = {
// Translation of section name (optional)
let section_trans = {
"news" : "News",
"posts" : "Posts",
// "other-section" : "Other Section"
};

View File

@ -1,3 +1,11 @@
{{ define "banner" }}
{{ $image := "" }}
{{ if .Resources.GetMatch "banner*" }}
{{ $image = .Resources.GetMatch "banner*" }}
{{ end }}
{{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
{{ end }}
{{ define "content" }}
{{ $partial := "" }}
{{ if eq .Params.tool "generator" }}