From 472a1ea2e41fcc220231bd163cd440124d6eddaa Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 21 Nov 2023 17:40:08 +0100 Subject: [PATCH] More updates --- docs/javascripts/readthedocs.js | 10 +++-- mkdocs.yml | 9 ---- overrides/partials/search.html | 77 --------------------------------- 3 files changed, 6 insertions(+), 90 deletions(-) delete mode 100644 overrides/partials/search.html diff --git a/docs/javascripts/readthedocs.js b/docs/javascripts/readthedocs.js index d4585bf..9d31343 100644 --- a/docs/javascripts/readthedocs.js +++ b/docs/javascripts/readthedocs.js @@ -1,5 +1,7 @@ -// Trigger Read the Docs' search addon instead of Material MkDocs default -document.querySelector(".md-search__input").addEventListener("focus", (e) => { - const event = new CustomEvent("readthedocs-search-show"); - document.dispatchEvent(event); +document.addEventListener("DOMContentLoaded", function(event) { + // Trigger Read the Docs' search addon instead of Material MkDocs default + document.querySelector(".md-search__input").addEventListener("focus", (e) => { + const event = new CustomEvent("readthedocs-search-show"); + document.dispatchEvent(event); + }); }); diff --git a/mkdocs.yml b/mkdocs.yml index 3603703..0b6ae14 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,9 +9,6 @@ site_url: !ENV READTHEDOCS_CANONICAL_URL theme: name: material - # Disable it for now - # custom_dir: overrides - # Include extra CSS to make some style adjustments extra_css: - stylesheets/readthedocs.css @@ -20,11 +17,5 @@ extra_css: extra_javascript: - javascripts/readthedocs.js -plugins: - - search: - # Disable the search plugin since it interferes with other hotkeys - enabled: false - - # I didn't find a good way to disable the "global" hotkeys. # https://github.com/squidfunk/mkdocs-material/discussions/4273#discussioncomment-3455176 diff --git a/overrides/partials/search.html b/overrides/partials/search.html deleted file mode 100644 index 727c8a5..0000000 --- a/overrides/partials/search.html +++ /dev/null @@ -1,77 +0,0 @@ - -