From 216780dc4b45febef67ae0130bd04a5a61c67fa8 Mon Sep 17 00:00:00 2001 From: vimux Date: Fri, 25 May 2018 13:03:05 +0300 Subject: [PATCH] Add partial post_toc.html for table of content --- README.md | 4 ++++ layouts/_default/single.html | 7 +------ layouts/partials/post_toc.html | 6 ++++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/post_toc.html diff --git a/README.md b/README.md index d3310e6..e492b5c 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3a1646a..ed55c50 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,12 +5,7 @@ {{- partial "post_thumbnail.html" (dict "page" . ) }}
{{ partial "post_meta.html" . }}

{{ .Title }}

- {{ if eq .Params.toc true }} -
- {{- T "post_toc" -}} - {{ .TableOfContents }} -
- {{ end }} + {{- partial "post_toc.html" . }}
{{ .Content }}
{{ if .Params.tags }}