diff options
| -rw-r--r-- | assets/js/ed.js | 20 | ||||
| -rw-r--r-- | assets/sass/_customize.scss | 4 | ||||
| -rw-r--r-- | i18n/en.toml | 3 | ||||
| -rw-r--r-- | i18n/ru.toml | 3 | ||||
| -rw-r--r-- | layouts/partials/hypothesis.html | 3 | ||||
| -rw-r--r-- | layouts/partials/sidebar-toc.html | 5 | ||||
| -rw-r--r-- | layouts/partials/sidebar.html | 4 | ||||
| -rw-r--r-- | netlify-preview.js | 18 | ||||
| -rw-r--r-- | netlify.toml | 6 |
9 files changed, 12 insertions, 54 deletions
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 @@ -<span class="hypothesis-container"> - <a class="sidebar-nav-item" id="hypothesis-link" href="#">{{ i18n "annotate" }}</a> -</span> 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 `<a href="(.*)">(.*)</a>` `<a class="sidebar-nav-item sidebar-nav-item-toc" href="$1">$2</a>` | safeHTML }} - {{ if ne .Params.annotations false }} - {{ $annotation := (partial "hypothesis.html" .) }} - {{ $toc = $toc | replaceRE `<nav class="sidebar-nav">` (printf `<nav class="sidebar-nav">%s` $annotation) | safeHTML }} - {{ end }} - {{ $home := printf `<a class="sidebar-nav-item" href="%s">%s</a>` site.Home.RelPermalink (i18n "home") | safeHTML }} {{ $toc = $toc | replaceRE `<nav class="sidebar-nav">` (printf `<nav class="sidebar-nav">%s` $home) | safeHTML }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 59d2360..0f7e19d 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -22,10 +22,6 @@ </a> {{- end }} - {{- if ne .Params.annotations false }} - {{ partial "hypothesis.html" . }} - {{- end }} - {{- with site.Menus.feeds }} <div class="sidebar-nav-item"> {{- range $i, $ := site.Menus.feeds }} diff --git a/netlify-preview.js b/netlify-preview.js index 5400d48..3b6a3a0 100644 --- a/netlify-preview.js +++ b/netlify-preview.js @@ -21,22 +21,22 @@ fs.readFile(path.resolve(__dirname, netlifyConfig), 'utf8', (err, data) => { // <- default-src 'self' blob:; line = line.replace(/(default-src) ('self')(;)/, '$1 $2 blob:$3'); - // -> style-src 'self' cdn.hypothes.is giscus.app; - // <- style-src 'self' 'unsafe-inline' cdn.hypothes.is giscus.app; - line = line.replace(/(style-src) ('self') (cdn\.hypothes\.is giscus\.app)(;)/, '$1 $2 $3 \'unsafe-inline\'$4'); + // -> style-src 'self' giscus.app; + // <- style-src 'self' 'unsafe-inline' giscus.app; + line = line.replace(/(style-src) ('self') (giscus\.app)(;)/, '$1 $2 $3 \'unsafe-inline\'$4'); // -> media-src 'self'; // <- media-src 'self' blob: https://app.netlify.com; line = line.replace(/(media-src) ('self')(;)/, '$1 $2 blob: https://app.netlify.com$3'); - // -> frame-src hypothes.is giscus.app; - // <- frame-src hypothes.is giscus.app app.netlify.com; - line = line.replace(/(frame-src) (hypothes\.is giscus\.app)(;)/, '$1 $2 app.netlify.com$3'); + // -> frame-src giscus.app; + // <- frame-src giscus.app app.netlify.com; + line = line.replace(/(frame-src) (giscus\.app)(;)/, '$1 $2 app.netlify.com$3'); - // -> script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app; - // <- script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app netlify-cdp-loader.netlify.app; + // -> script-src 'self' www.googletagmanager.com giscus.app; + // <- script-src 'self' www.googletagmanager.com giscus.app netlify-cdp-loader.netlify.app; line = line.replace( - /(script-src) ('self' www\.googletagmanager\.com hypothes\.is cdn\.hypothes\.is giscus\.app)(;)/, + /(script-src) ('self' www\.googletagmanager\.com giscus\.app)(;)/, '$1 $2 netlify-cdp-loader.netlify.app$3' ); diff --git a/netlify.toml b/netlify.toml index d1d557c..e0e6473 100644 --- a/netlify.toml +++ b/netlify.toml @@ -88,14 +88,14 @@ # (including inline scripts and event-handling HTML attributes). Content-Security-Policy = """ default-src 'self'; - script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app; - style-src 'self' cdn.hypothes.is giscus.app; + script-src 'self' www.googletagmanager.com giscus.app; + style-src 'self' giscus.app; img-src 'self' data: *.google-analytics.com www.googletagmanager.com www.gstatic.com stats.g.doubleclick.net; font-src 'self'; connect-src 'self' *.google-analytics.com *.analytics.google.com analytics.google.com www.googletagmanager.com stats.g.doubleclick.net; media-src 'self'; object-src 'self'; - frame-src hypothes.is giscus.app; + frame-src giscus.app; worker-src 'self'; frame-ancestors 'none'; form-action 'self' submit-form.com; |
