From 1f388391278dadf2cae977141a432aa2f39d8614 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Mon, 17 Mar 2025 20:04:41 +0800 Subject: Remove hypothesis for annotation support. --- assets/js/ed.js | 20 -------------------- assets/sass/_customize.scss | 4 ---- i18n/en.toml | 3 --- i18n/ru.toml | 3 --- layouts/partials/hypothesis.html | 3 --- layouts/partials/sidebar-toc.html | 5 ----- layouts/partials/sidebar.html | 4 ---- netlify-preview.js | 18 +++++++++--------- netlify.toml | 6 +++--- 9 files changed, 12 insertions(+), 54 deletions(-) delete mode 100644 layouts/partials/hypothesis.html diff --git a/assets/js/ed.js b/assets/js/ed.js index b4ba4d6..fb75c94 100644 --- a/assets/js/ed.js +++ b/assets/js/ed.js @@ -13,26 +13,6 @@ function setupBackToTop() { } } -// Annotation support -function setupHypothes() { - const hypothesisContainer = document.querySelector('.hypothesis-container'); - if (hypothesisContainer !== null) { - hypothesisContainer.addEventListener('click', e => { - e.preventDefault(); - - let script = document.createElement('script'); - script.setAttribute('src', 'https://cdn.hypothes.is/hypothesis'); - script.type = 'text/javascript'; - document.getElementsByTagName('head')[0].appendChild(script); - }); - } - - const hypothesisLink = document.querySelector('#hypothesis-link'); - if (hypothesisLink !== null) { - hypothesisContainer.addEventListener('click', e => e.preventDefault()); - } -} - document.addEventListener('DOMContentLoaded', () => { setupBackToTop(); setupHypothes(); diff --git a/assets/sass/_customize.scss b/assets/sass/_customize.scss index ca681cd..f2552e0 100644 --- a/assets/sass/_customize.scss +++ b/assets/sass/_customize.scss @@ -286,7 +286,3 @@ ul.tags-cloud { .screen-reader-text { @include visually-hidden(); } - -.hypothesis-container { - cursor: pointer; -} diff --git a/i18n/en.toml b/i18n/en.toml index 2f44e07..eb86647 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -69,6 +69,3 @@ [back_to_top_label] other = 'Back to top of the page' - -[annotate] - other = 'Annotate me' diff --git a/i18n/ru.toml b/i18n/ru.toml index 6a782ef..1920721 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -69,6 +69,3 @@ [back_to_top_label] other = 'Вернуться в начало страницы' - -[annotate] - other = 'Добавить аннотацию' diff --git a/layouts/partials/hypothesis.html b/layouts/partials/hypothesis.html deleted file mode 100644 index 1417ea3..0000000 --- a/layouts/partials/hypothesis.html +++ /dev/null @@ -1,3 +0,0 @@ - - {{ i18n "annotate" }} - diff --git a/layouts/partials/sidebar-toc.html b/layouts/partials/sidebar-toc.html index 5f4ff7e..0e9f1fb 100644 --- a/layouts/partials/sidebar-toc.html +++ b/layouts/partials/sidebar-toc.html @@ -13,11 +13,6 @@ {{ $toc = $toc | replaceRE "(<[/]?ul>|<[/]?ol>|<[/]?li>)" "" | safeHTML }} {{ $toc = $toc | replaceRE `(.*)` `$2` | safeHTML }} - {{ if ne .Params.annotations false }} - {{ $annotation := (partial "hypothesis.html" .) }} - {{ $toc = $toc | replaceRE `