-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Needed: documentationDocumentation is requiredDocumentation is required
Description
We have a similar section in our MkDocs documentation, but I wasn't able to find how to disable the native search on Zensical and it triggers both modals, which is annoying.
Configure Read the Docs search
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To configure your site to use :doc:`Read the Docs search </server-side-search/index>` instead of the default search:
#. Add the following block of JavaScript:
.. code-block:: js
:caption: assets/javascript/readthedocs.js
document.addEventListener("DOMContentLoaded", function(event) {
// Trigger Read the Docs' search addon instead of Zensical default
document.querySelector(".md-search").addEventListener("click", (e) => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
});
});
#. Include ``assets/javascript/readthedocs.js`` in your MkDocs configuration:
.. code-block:: toml
:caption: zensical.toml
[project]
extra_javascript = ["assets/javascript/readthedocs.js"]Metadata
Metadata
Assignees
Labels
Needed: documentationDocumentation is requiredDocumentation is required