From abd51f109bfa17642d306deed1a0b0c229b0af18 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 23 Jan 2022 18:22:47 -0800 Subject: layout: proper TOC There's a need for two TOCs in the layout: one for when the page is on mobile; one for non mobile. When we are on mobile, we display the first TOC, before the article. When we're not on mobile, we hide that TOC and display one after the document. We restructure a bit the layout so that's it's a bit more readable too, and close tags properly. --- users/fcuny/blog/layouts/_default/single.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/users/fcuny/blog/layouts/_default/single.html b/users/fcuny/blog/layouts/_default/single.html index 4f21ded..524145a 100644 --- a/users/fcuny/blog/layouts/_default/single.html +++ b/users/fcuny/blog/layouts/_default/single.html @@ -1,6 +1,6 @@ {{ define "main" }} -
+

{{ .Title }}

@@ -32,14 +32,23 @@
{{ if .Params.toc }} -
- Table of Contents +
+ Table of contents {{ .TableOfContents }}
{{ end }} +
{{ .Content }} +
+ +
-
+{{ if .Params.toc }} +
+ Table of contents + {{ .TableOfContents }} +
+{{ end }} {{ end }} -- cgit 1.4.1