[gimp-web-devel/pat/bootstrap] theme: fix empty TOC div showing double lines



commit c2feeb475b0f50eda67b6919f50457bb3d025fbc
Author: Pat David <patdavid gmail com>
Date:   Tue Sep 13 20:28:23 2022 -0500

    theme: fix empty TOC div showing double lines
    
    I had a div containing the TOC stuff that had borders on top
    and bottom that don't look good when the TOC is empty.
    
    This commit fixes that.
    Also, tested by adding `toc: false` to conferences/_index.md

 content/conferences/_index.md |  1 +
 layouts/_default/section.html |  8 +++-----
 layouts/partials/toc.html     | 16 +++++++++-------
 3 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/content/conferences/_index.md b/content/conferences/_index.md
index 051881f..b121672 100644
--- a/content/conferences/_index.md
+++ b/content/conferences/_index.md
@@ -6,6 +6,7 @@ date: 2022-08-06T12:49:14-0500
 author: 'Pat David'
 menu: main
 weight: 3
+toc: false
 show_subs: false
 ---
 
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 537f27c..1e71fc2 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -5,11 +5,9 @@
     <h1 class="title">{{ .Title }}</h1>
 
     {{ if gt .WordCount 400  }}
-            {{ if or (not (isset .Params "toc")) (.Params.toc) }}
-                            <div class='col border-bottom border-top pt-2 my-3'>
-                                    {{ partial "toc.html" . }}
-                            </div>
-                            {{ end }}
+        {{ if or (not (isset .Params "toc")) (.Params.toc) }}
+          {{ partial "toc.html" . }}
+        {{ end }}
     {{ end }}
 
     {{ .Content }}
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 580ea22..2b8d1bc 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,8 +1,10 @@
-{{ with .TableOfContents }}
-  {{ if ne . "<nav id=\"TableOfContents\"></nav>" }}
-    <div class='h6 text-muted toctitle text-secondary'>Table of Contents</div>
-    <small>
-    {{ . }}
-    </small>
+<div class='col border-bottom border-top pt-2 my-3'>
+  {{ with .TableOfContents }}
+    {{ if ne . "<nav id=\"TableOfContents\"></nav>" }}
+      <div class='h6 text-muted toctitle text-secondary'>Table of Contents</div>
+      <small>
+      {{ . }}
+      </small>
+    {{ end }}
   {{ end }}
-{{ end }}
+</div>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]