Skip to content

Commit

Permalink
fix: adjust to Hugo v0.112.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed May 23, 2023
1 parent 0df0e2c commit e2715f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion layouts/partials/search/assets/js-resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
{{- $years := slice }}
{{- if default true site.Params.search.filter_years }}
{{- $indexAllPages := default true .Site.Params.search.index_all_pages }}
{{- $pages := cond $indexAllPages .Site.AllPages .Site.AllRegularPages }}
{{- $pages := .Site.AllPages }}
{{- if not $indexAllPages }}
{{- $pages = where $pages "kind" "page" }}
{{- end }}
{{- $pages = where $pages "Params.noindex" "ne" true }}
{{- with $pages.GroupByDate "2006" }}
{{- range . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/search/functions/search-index-hash.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{/* This hashing function just calculate the number of pages and the lastmod time. */}}
{{- $ctx := dict "Site" . }}
{{- $pages := partialCached "search/functions/pages" $ctx $ctx -}}
{{- $pages := partialCached "search/functions/pages" $ctx .Language.Lang -}}
{{- $hash := printf "total=%d" $pages.Len }}
{{- $latest := first 1 $pages.ByLastmod.Reverse }}
{{- with index $latest 0 }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/search/index.json.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $indexContent := default false .Site.Params.search.index_content -}}
{{- $years := true }}
{{- $pagesCtx := dict "Site" .Site }}
{{- $pages := partialCached "search/functions/pages" $pagesCtx $pagesCtx -}}
{{- $pages := partialCached "search/functions/pages" $pagesCtx .Site.Language.Lang -}}
{{- range $pages -}}
{{- $page := . -}}
{{- $item := newScratch -}}
Expand Down

0 comments on commit e2715f4

Please sign in to comment.