Skip to content

Commit

Permalink
themes: book: apply search hotfix from upstream (#17)
Browse files Browse the repository at this point in the history
This fixes the search by applying the hotfix from upstream
alex-shpak/hugo-book@26fee55
See issue alex-shpak/hugo-book#528
upstream for more details.

Closes #16
  • Loading branch information
elopez authored Aug 7, 2023
1 parent e57c0ec commit 08a2e28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/book/assets/search-data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[
{{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
{{- $pages = where $pages "Params.booksearchexclude" "!=" true -}}
{{- $pages = where $pages "Content" "not in" (slice nil "") -}}
{{/* Remove until we know why it does not work, see https://github.com/alex-shpak/hugo-book/issues/528 */}}
{{/*- $pages = where $pages "Content" "not in" (slice nil "") -*/}}
{{- $pages = where $pages "Content" "!=" "" -}}

{{ range $index, $page := $pages }}
{{ if gt $index 0}},{{end}} {
Expand Down

1 comment on commit 08a2e28

@simonpkerr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually remove pages where content is empty? its not working for me

Please sign in to comment.