Skip to content

Commit

Permalink
fix: this should fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
ClockRide committed Feb 21, 2024
1 parent 527bb83 commit 42885ea
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ validation:

extra_javascript:
- _site_essentials/js/mathjax.js
- /docsbot/docsbot.min.js
# - /docsbot/docsbot.min.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js
Expand Down
40 changes: 38 additions & 2 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
</div>
{% endif %}

<div id="__cookbook" data-api-key="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWQxNWI0YTUyNTcyZmMzMDI2ODg1OTgiLCJpYXQiOjE3MDgyMTkyMTAsImV4cCI6MjAyMzc5NTIxMH0.kjO3jaiDucVtCmF-665MVeRBd-VBm5MYYvwrzoIfVyQ"></div>
<!-- <div id="__cookbook" data-api-key="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWQxNWI0YTUyNTcyZmMzMDI2ODg1OTgiLCJpYXQiOjE3MDgyMTkyMTAsImV4cCI6MjAyMzc5NTIxMH0.kjO3jaiDucVtCmF-665MVeRBd-VBm5MYYvwrzoIfVyQ"></div> -->
{% endblock %}

{% block styles %}
<!-- Deprioritizing the docsbot stylesheet to avoid conflicts with the theme -->
<link rel="stylesheet" href="/docsbot/docsbot.css" />
<!-- <link rel="stylesheet" href="/docsbot/docsbot.css" /> -->

{{ super() }}
{% endblock %}
Expand All @@ -28,4 +28,40 @@
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MQWH3L28"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

<script>
setTimeout(function () {
if (window && !window.document.getElementById("__cookbook")) {
const cookbookContainer = document.createElement("div");
cookbookContainer.id = "__cookbook";
cookbookContainer.setAttribute(
"data-api-key",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWQxNWI0YTUyNTcyZmMzMDI2ODg1OTgiLCJpYXQiOjE3MDgyMTkyMTAsImV4cCI6MjAyMzc5NTIxMH0.kjO3jaiDucVtCmF-665MVeRBd-VBm5MYYvwrzoIfVyQ"
);
document.body.appendChild(cookbookContainer);

const hmrScript = document.createElement("script");
hmrScript.type = "module";
hmrScript.innerHTML = `
import RefreshRuntime from "http://localhost:5003/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
`;
document.head.appendChild(hmrScript);

const hmrScript2 = document.createElement("script");
hmrScript2.src = "http://localhost:5003/@vite/client";
hmrScript2.type = "module";
document.head.appendChild(hmrScript2);

// styles are injected in main.tsx so no need to add them in dev mode
const cookbookScript = document.createElement("script");
cookbookScript.src = "http://localhost:5003/src/main.tsx";
cookbookScript.type = "module";
document.head.appendChild(cookbookScript);
}
}, 0);
</script>
{% endblock %}

0 comments on commit 42885ea

Please sign in to comment.