Skip to content

Commit

Permalink
fix: check if the .File.UniqueID exists before accessing it (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang authored Aug 10, 2023
1 parent be78b88 commit 362bb2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion layouts/partials/hb/modules/docs/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ <h5 class="offcanvas-title" id="hb-docs-nav-label">
{{- $active = true }}
{{- end }}
<li class="hb-docs-nav-links-group">
{{- $collapseId := printf "collapse-%s" $node.Page.File.UniqueID }}
{{- $collapseId := "" }}
{{- with $node.Page.File }}
{{- $collapseId = printf "collapse-%s" .UniqueID }}
{{- else }}
{{- $collapseId = printf "collapse-%d" now.UnixNano }}
{{- end }}
<div
class="hb-docs-nav-heading d-flex align-items-center justify-content-between rounded{{ cond $active ` active` `` }}">
<a
Expand Down

0 comments on commit 362bb2f

Please sign in to comment.