Skip to content

Commit

Permalink
fix: check before parsing headings
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 8, 2024
1 parent b9bf5a7 commit 1af30b8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions layouts/partials/search/functions/parse-headings.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- $headings := slice }}
{{- range .Fragments.HeadingsMap }}
{{- $headings = $headings | append (dict
"anchor" .ID
"title" (.Title | plainify))
}}
{{- with .Fragments }}
{{- range .HeadingsMap }}
{{- $headings = $headings | append (dict
"anchor" .ID
"title" (.Title | plainify))
}}
{{- end }}
{{- end }}
{{- return $headings -}}

0 comments on commit 1af30b8

Please sign in to comment.