Add GetFoxChat to your MkDocs (Material for MkDocs) site
As of November 3, 2026, to add GetFoxChat to MkDocs (Material for MkDocs), in a theme override, overrides/main.html, inside the scripts block after {{ super() }} (MkDocs (Material for MkDocs)'s own guide, September 30, 2026). The video on this page shows GetFoxChat installed, tested and running in 4 minutes (watch it).
Watch it first
▶ Watch how
The line to add
Yours has your own site ID in place of YOUR_SITE_ID.
<script src="https://getfoxchat.com/widget.js" data-site-id="YOUR_SITE_ID" defer></script>
On MkDocs (Material for MkDocs), this is what goes in overrides/main.html:
{% extends "base.html" %}
{% block scripts %}
{{ super() }}
<script src="https://getfoxchat.com/widget.js" data-site-id="YOUR_SITE_ID" defer></script>
{% endblock %}
How do you add GetFoxChat to MkDocs (Material for MkDocs), step by step?
- In GetFoxChat, open the install step for your site and copy your snippet. It already has your site ID in it. No account yet? Create one free.
- In mkdocs.yml, under theme, set
custom_dir: overridesand create an overrides folder next to mkdocs.yml. source - Create overrides/main.html (or open it if it already exists). source
- Add {% extends "base.html" %} and a {% block scripts %} that calls {{ super() }} first, then the GetFoxChat line, then {% endblock %}. source
- Replace YOUR_SITE_ID with your site ID, then rebuild with mkdocs build and redeploy. source
- Back in GetFoxChat, press Check my site. The chat switches on once GetFoxChat finds the snippet on your live pages.
MkDocs (Material for MkDocs)'s own guide: Material for MkDocs: Customization. Checked 2026-09-30; if MkDocs (Material for MkDocs) renames a menu, its guide has the current wording.
MkDocs (Material for MkDocs) gotchas
extra_javascriptin mkdocs.yml only accepts path, type, async and defer, so it cannot set the data-site-id attribute; use the theme override instead. source- Theme overrides need Material for MkDocs installed via pip and named in mkdocs.yml; they do not work with a theme cloned from git. source
- With instant loading turned on, moving between pages does not refresh the browser page, so test the chat after clicking between pages. source
How do you remove it later?
Delete the GetFoxChat line from overrides/main.html (and the scripts block if it held nothing else), then rebuild and redeploy.
Steps are for the Material for MkDocs theme. Plain MkDocs themes also support custom_dir, but block names differ per theme.
Find out what your visitors can't find
See the 5 questions your visitors are likely to ask that your pages don't clearly answer. Free, no account needed.
Your AI Operator starts as Foxy. Rename it and give it your own avatar in Settings. Plans and what each includes: pricing.