From 26b12aadf6b8485facc7e711afb40d86866d5368 Mon Sep 17 00:00:00 2001 From: daudix Date: Fri, 18 Oct 2024 18:16:38 +0300 Subject: [PATCH] Rewrite half the theme to make Mozilla observatory more happy about strict CSP --- CHANGELOG.md | 4 + config.toml | 4 +- sass/_hidden.scss | 9 +- sass/_visually-hidden.scss | 9 + sass/style.scss | 1 + static/comments.js | 349 ++++++++++++++++ static/copy-button.js | 57 +++ static/search-elasticlunr.js | 209 ++++++++++ .../search_fuse.html => static/search-fuse.js | 12 +- static/theme-switcher.js | 10 + templates/404.html | 2 +- templates/article.html | 57 ++- templates/base.html | 1 + templates/partials/comments.html | 381 ------------------ templates/partials/copy_button.html | 59 --- templates/partials/extra_features.html | 8 + templates/partials/head.html | 18 +- templates/partials/nav.html | 10 +- templates/partials/search_elasticlunr.html | 209 ---------- 19 files changed, 730 insertions(+), 679 deletions(-) create mode 100644 sass/_visually-hidden.scss create mode 100644 static/comments.js create mode 100644 static/copy-button.js create mode 100644 static/search-elasticlunr.js rename templates/partials/search_fuse.html => static/search-fuse.js (87%) delete mode 100644 templates/partials/comments.html delete mode 100644 templates/partials/copy_button.html create mode 100644 templates/partials/extra_features.html delete mode 100644 templates/partials/search_elasticlunr.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c1f1d5..bd3850d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,11 +20,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **[BREAKING]** Rename the visually hidden `hidden` class to `visually-hidden`. `hidden` is now used to completely hide the elements, including screen readers. - Make `emoji` class available outside of comments. - Make the code and styling for article cards much cleaner. - Make the shortcodes code much cleaner. - Remove top/bottom margin from the first/last element in `