From 283662fb44a19c6ab7a8f14b510506edd8c02950 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 24 Jul 2022 23:46:23 +0200 Subject: Allow disable hypothesis on custom pages --- layouts/partials/sidebar-toc.html | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'layouts/partials/sidebar-toc.html') diff --git a/layouts/partials/sidebar-toc.html b/layouts/partials/sidebar-toc.html index 9361aab..a6ac8d3 100644 --- a/layouts/partials/sidebar-toc.html +++ b/layouts/partials/sidebar-toc.html @@ -9,10 +9,20 @@ {{ $toc := .Page.TableOfContents }} {{ $home := printf `%s` site.Home.RelPermalink (i18n "home") | safeHTML }} + {{ $annotation := "" }} + + {{ if ne .Params.annotations false }} + {{ $annotation = (partial "hypothesis.html" .) }} + {{ end }} {{ $toc = $toc | replaceRE `id="TableOfContents"` `class="sidebar-nav"` | safeHTML }} {{ $toc = $toc | replaceRE "(<[/]?ul>|<[/]?ol>|<[/]?li>)" "" | safeHTML }} {{ $toc = $toc | replaceRE `(.*)` `$2` | safeHTML }} + + {{ if ne .Params.annotations false }} + {{ $toc = $toc | replaceRE `