mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-17 09:10:08 +00:00
Merge branch 'fix-index-json-encoding' of git://github.com/helfper/hugo-theme-relearn into helfper-fix-index-json-encoding
This commit is contained in:
commit
a78207ab4e
2 changed files with 9 additions and 12 deletions
|
@ -23,6 +23,8 @@ Note that some of these parameters are explained in details in other sections of
|
||||||
showVisitedLinks = false
|
showVisitedLinks = false
|
||||||
# Disable search function. It will hide search bar
|
# Disable search function. It will hide search bar
|
||||||
disableSearch = false
|
disableSearch = false
|
||||||
|
# Make hidden pages searchable
|
||||||
|
searchHiddenPages = false
|
||||||
# Javascript and CSS cache are automatically busted when new version of site is generated.
|
# Javascript and CSS cache are automatically busted when new version of site is generated.
|
||||||
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
|
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
|
||||||
disableAssetsBusting = false
|
disableAssetsBusting = false
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
[{{ range $index, $page := .Site.Pages }}
|
{{- $pages := slice }}
|
||||||
{{- if ne $page.Type "json" -}}
|
{{- range .Site.Pages }}
|
||||||
{{- if and $index (gt $index 0) -}},{{- end }}
|
{{- if or .Site.Params.searchHiddenPages (and (ne .Params.hidden true) (ne .Title "")) }}
|
||||||
{
|
{{- $pages = $pages | append (dict "uri" .RelPermalink "title" .Title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }}
|
||||||
"uri": "{{ $page.RelPermalink }}",
|
{{- end }}
|
||||||
"title": "{{ htmlEscape $page.Title}}",
|
{{- end }}
|
||||||
"tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}],
|
{{- $pages | jsonify (dict "indent" " ") }}
|
||||||
"description": "{{ htmlEscape .Description}}",
|
|
||||||
"content": {{$page.Plain | jsonify}}
|
|
||||||
}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}]
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue