mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-11 01:38:28 +00:00
Add partial post_toc.html for table of content
This commit is contained in:
parent
ab7d847e21
commit
216780dc4b
3 changed files with 11 additions and 6 deletions
|
@ -9,6 +9,8 @@
|
|||
* Responsive
|
||||
* Card-based list layout
|
||||
* Internal Hugo templates for Open Graph and Twitter Cards meta data, google analytics, and Disqus comments
|
||||
* Table of contents
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -31,6 +33,8 @@ twitter_cards = true # Enable Twitter Cards if true
|
|||
cardsPerRow = 2 # Possible values: 1, 2, 3
|
||||
#mainSections = ["post"] # Set main page sections
|
||||
#dateFormat = "2006-01-02" # change the format of dates
|
||||
#comments:
|
||||
#toc: true #
|
||||
|
||||
[Params.Social]
|
||||
#facebook = "username"
|
||||
|
|
|
@ -5,12 +5,7 @@
|
|||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
|
||||
<h1 class="post__title">{{ .Title }}</h1>
|
||||
{{ if eq .Params.toc true }}
|
||||
<details class="post__toc toc" {{ if .Params.tocOpen }}open{{ end }}>
|
||||
<summary class="toc__title">{{- T "post_toc" -}}</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
{{ end }}
|
||||
{{- partial "post_toc.html" . }}
|
||||
<div class="post__content">{{ .Content }}</div>
|
||||
{{ if .Params.tags }}
|
||||
<footer class="post__footer">
|
||||
|
|
6
layouts/partials/post_toc.html
Normal file
6
layouts/partials/post_toc.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{ if .Params.toc }}
|
||||
<details class="post__toc toc" {{ if .Params.tocOpen }}open{{ end }}>
|
||||
<summary class="toc__title">{{- T "post_toc" -}}</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
{{ end }}
|
Loading…
Reference in a new issue