Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions assets/json/offline-search-index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- $.Scratch.Add "offline-search-index" slice -}}
{{- range where site.AllPages ".Params.exclude_search" "!=" true -}}
{{- /* We have to apply `htmlUnescape` again after `truncate` because `truncate` applies `html.EscapeString` if the argument is not HTML. */ -}}
{{- /* Individual taxonomies can be added in the next line by add '"taxonomy-name" (.Params.taxonomy-name | default "")' to the dict (as seen for categories and tags). */ -}}
{{- $.Scratch.Add
"offline-search-index"
(dict
"ref" .RelPermalink
"title" .Title
"categories" (.Params.categories | default "")
"tags" (.Params.tags | default "")
"description" (.Description | default "")
"body" (.Plain | htmlUnescape)
"excerpt" ((.Description | default .Plain) | htmlUnescape | truncate (.Site.Params.offlineSearchSummaryLength | default 70) | htmlUnescape)
)
-}}
{{- end -}}
{{- $.Scratch.Get "offline-search-index" | jsonify -}}
2 changes: 1 addition & 1 deletion layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Site.AllPages }}
{{ range site.AllPages }}
{{- if and (not .Params.sitemap_exclude) (not .Draft) }}
<url>
<loc>{{ .Permalink }}</loc>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/feature-info.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $currentPage := .Page.Permalink }}
{{ $features := .Site.Data.feature_data }}
{{ $features :=hugo.Data.feature_data }}
{{ if not $features }}
{{ with readFile "data/feature_data.json" }}
{{ $features = . | transform.Unmarshal }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/recent-discussions.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if eq .Section "kanvas" }}
<h2>Recent Discussions on Kanvas</h2>
<ul>
{{ with site.Data.kanvas_discuss }}
{{ with hugo.Data.kanvas_discuss }}
{{ $users := .users }}
{{ $topics := sort .topic_list.topics "last_posted_at" "desc" }}

Expand Down
Loading