mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
nav: only show toc if the page has headings #182
This commit is contained in:
parent
46328c3bc0
commit
3d6a95434c
2 changed files with 3 additions and 2 deletions
|
@ -44,7 +44,8 @@
|
|||
{{- end }}
|
||||
{{- $defaultDisableToc := .Site.Params.disableToc | default false }}
|
||||
{{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }}
|
||||
{{- $toc := (and (not $currentDisableToc) (not .Params.chapter)) }}
|
||||
{{- $hastoc := not (eq 0 (int (len (.TableOfContents | plainify)))) }}
|
||||
{{- $toc := (and $hastoc (not $currentDisableToc) (not .Params.chapter)) }}
|
||||
<div id="breadcrumbs">
|
||||
<span id="sidebar-toggle-span">
|
||||
<a href="#" id="sidebar-toggle" title='{{ T "Navigation-toggle" }}' data-sidebar-toggle="">
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
{{- $themevariants := slice | append .Site.Params.themeVariant }}
|
||||
{{- $showthemeswitch := gt (int (len $themevariants)) 1 }}
|
||||
{{- $footer := partial "menu-footer.html" . }}
|
||||
{{- $showfooter := not (eq 0 (int (len $footer | plainify))) }}
|
||||
{{- $showfooter := not (eq 0 (int (len ($footer | plainify)))) }}
|
||||
{{- if or $showlangswitch $showvisitedlinks $showfooter }}
|
||||
<hr class="default-animation"/>
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue