mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
parent
fe94d7f347
commit
6d6fe2c389
@ -23,16 +23,7 @@
|
|||||||
{{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden}}
|
{{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden}}
|
||||||
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
|
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
|
||||||
{{- if (.Param "ShowToc") }}
|
{{- if (.Param "ShowToc") }}
|
||||||
<div class="toc">
|
|
||||||
<details {{if (.Param "TocOpen") }} open{{ end }}>
|
|
||||||
<summary accesskey="c" title="(Alt + C)">
|
|
||||||
<div class="details">{{- i18n "toc" | default "Table of Contents" }}</div>
|
|
||||||
</summary>
|
|
||||||
<div class="inner">
|
|
||||||
{{- partial "toc.html" . }}
|
{{- partial "toc.html" . }}
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{- partial "anchored_headings.html" .Content -}}
|
{{- partial "anchored_headings.html" .Content -}}
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
<div class="toc">
|
||||||
|
<details {{if (.Param "TocOpen") }} open{{ end }}>
|
||||||
|
<summary accesskey="c" title="(Alt + C)">
|
||||||
|
<div class="details">{{- i18n "toc" | default "Table of Contents" }}</div>
|
||||||
|
</summary>
|
||||||
|
<div class="inner">
|
||||||
{{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}}
|
{{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}}
|
||||||
{{- $has_headers := ge (len $headers) 1 -}}
|
{{- $has_headers := ge (len $headers) 1 -}}
|
||||||
{{- if $has_headers -}}
|
{{- if $has_headers -}}
|
||||||
@ -82,3 +88,6 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user