textual improvements, use param showtoc for TOC
This commit is contained in:
parent
dcdd716553
commit
e4bfa2b3a2
2 changed files with 5 additions and 5 deletions
|
@ -4,8 +4,8 @@
|
||||||
{{- $url := "" -}}
|
{{- $url := "" -}}
|
||||||
{{- $anchor := "" -}}
|
{{- $anchor := "" -}}
|
||||||
{{- if reflect.IsMap . -}}
|
{{- if reflect.IsMap . -}}
|
||||||
{{- $anchor = .anchor}}
|
{{- $anchor = .anchor -}}
|
||||||
{{- $page = .page}}
|
{{- $page = .page -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if ne $anchor "" -}}
|
{{- if ne $anchor "" -}}
|
||||||
{{- $url = printf "%s#%v" $page.Permalink $anchor -}}
|
{{- $url = printf "%s#%v" $page.Permalink $anchor -}}
|
||||||
|
|
|
@ -65,8 +65,8 @@
|
||||||
{{- $section := or .Section "posts" -}}
|
{{- $section := or .Section "posts" -}}
|
||||||
{{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}}
|
{{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}}
|
||||||
{{- $related := first 20 (where .Site.RegularPages "Section" $section) -}}
|
{{- $related := first 20 (where .Site.RegularPages "Section" $section) -}}
|
||||||
{{- partial "card-related"
|
{{- partial "card-related"
|
||||||
(dict "related" $related "header" $header "id" "articles-in-section") -}}
|
(dict "related" $related "header" $header "id" "articles-in-section") -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ if .Site.Params.showBacklinks -}}
|
{{ if .Site.Params.showBacklinks -}}
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
(dict "related" $related "header" (i18n "backlinks") "id" "backlinks") -}}
|
(dict "related" $related "header" (i18n "backlinks") "id" "backlinks") -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ if .Params.toc -}}
|
{{ if .Params.showtoc -}}
|
||||||
<div class="card mt-3">
|
<div class="card mt-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h4 class="card-text">{{i18n "toc"}}</h4>
|
<h4 class="card-text">{{i18n "toc"}}</h4>
|
||||||
|
|
Loading…
Add table
Reference in a new issue