From 8fc9a3c7c527eced34117a30e6ddb4d3d0bd55c8 Mon Sep 17 00:00:00 2001 From: vimux Date: Tue, 22 May 2018 16:36:26 +0300 Subject: [PATCH] Add initial Table of Contents --- i18n/en.yaml | 3 +++ layouts/_default/single.html | 6 ++++++ static/css/main.css | 32 +++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/i18n/en.yaml b/i18n/en.yaml index 0e6ecac..1dc5370 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,4 +1,7 @@ # Post +- id: post_toc + translation: Table of Contents + - id: meta_lastmod translation: Updated diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4830b53..286c290 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,6 +5,12 @@ {{- partial "post_thumbnail.html" (dict "page" . ) }}
{{ partial "post_meta.html" . }}

{{ .Title }}

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