From 1f644e51028a77b2e3ef2de33d3497f8bf565ad2 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/notes/layouts/_default/single.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'users/fcuny/notes/layouts/_default') diff --git a/users/fcuny/notes/layouts/_default/single.html b/users/fcuny/notes/layouts/_default/single.html index 4f21ded..524145a 100644 --- a/users/fcuny/notes/layouts/_default/single.html +++ b/users/fcuny/notes/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