about summary refs log tree commit diff
path: root/users/fcuny/blog/layouts/_default/single.html
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-01-23 18:22:47 -0800
committerFranck Cuny <franck@fcuny.net>2022-01-23 18:22:47 -0800
commitabd51f109bfa17642d306deed1a0b0c229b0af18 (patch)
tree8ad37027190f0ddbdcbd231b8936299a21016b98 /users/fcuny/blog/layouts/_default/single.html
parentlayout: wrap content in an "article" tag (diff)
downloadworld-abd51f109bfa17642d306deed1a0b0c229b0af18.tar.gz
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.
Diffstat (limited to '')
-rw-r--r--users/fcuny/blog/layouts/_default/single.html17
1 files 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" }}
 
-<article class="article">
+<div>
 
 <h1>{{ .Title }}</h1>
 
@@ -32,14 +32,23 @@
 </div>
 
 {{ if .Params.toc }}
-<div class="toc">
-  <strong>Table of Contents</strong>
+<div id="toc_small">
+  <summary>Table of contents</summary>
   {{ .TableOfContents }}
 </div>
 {{ end }}
 
+<article class="article">
 {{ .Content }}
+</article>
+
+</div>
 
-<article>
+{{ if .Params.toc }}
+<div class="toc">
+  <strong>Table of contents</strong>
+  {{ .TableOfContents }}
+</div>
+{{ end }}
 
 {{ end }}