Skip to content

Commit

Permalink
feat: add the headings_end_level parameter, default to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Sep 9, 2024
1 parent 0e06ef2 commit d6ba834
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ filter_taxonomies = true
filter_years = true
histories = true
histories_count = 5
headings_end_level = 6

[params.search.key_weights]
title = 1
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/search/functions/walk-headings.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{- $v := slice }}
{{- $pid := .PID }}
{{- range .Headings }}
{{- if gt .Level (default 6 site.Params.search.headings_end_level) }}
{{- break }}
{{- end }}
{{- if ne .Title "" }}
{{- $v = $v | append (dict
"pid" $pid
Expand Down

0 comments on commit d6ba834

Please sign in to comment.