[gimp-web-devel/pat/bootstrap] content, layouts: improve the toc partial again.



commit 36fc3065582010c85dcf9d20248fad4b5e775129
Author: Jehan <jehan girinstud io>
Date:   Wed Sep 14 16:44:35 2022 +0200

    content, layouts: improve the toc partial again.
    
    This is an enhancement over previous commit c2feeb4. Basically the
    border lines should be inside the test for an empty TableOfContents.
    This way, we don't even need to add `toc: false` on a page where there
    would be no table of contents anyway (even if long in number of words).

 content/conferences/_index.md |  1 -
 layouts/partials/toc.html     | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/content/conferences/_index.md b/content/conferences/_index.md
index b121672..051881f 100644
--- a/content/conferences/_index.md
+++ b/content/conferences/_index.md
@@ -6,7 +6,6 @@ date: 2022-08-06T12:49:14-0500
 author: 'Pat David'
 menu: main
 weight: 3
-toc: false
 show_subs: false
 ---
 
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 2b8d1bc..baa3153 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,10 +1,10 @@
-<div class='col border-bottom border-top pt-2 my-3'>
-  {{ with .TableOfContents }}
-    {{ if ne . "<nav id=\"TableOfContents\"></nav>" }}
+{{ with .TableOfContents }}
+  {{ if ne . "<nav id=\"TableOfContents\"></nav>" }}
+    <div class='col border-bottom border-top pt-2 my-3'>
       <div class='h6 text-muted toctitle text-secondary'>Table of Contents</div>
       <small>
       {{ . }}
       </small>
-    {{ end }}
+    </div>
   {{ end }}
-</div>
+{{ end }}


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