Install Foresite on MkDocs
These steps work for Material for MkDocs and MkDocs' built-in themes.
-
In
mkdocs.yml, point the theme at a folder for your overrides:theme: name: material custom_dir: overrides -
Create
overrides/main.htmlwith your Foresite line in theextraheadblock:{% extends "base.html" %} {% block extrahead %} <script defer src="https://t.foresite.dev/s/YOUR_SITE_ID.js"></script> {% endblock %} -
Build and deploy.
If you turned on Material's instant navigation (navigation.instant), Foresite still counts each page change as a pageview. Visits to localhost aren't counted, so test on your published docs: the Installation Check in Settings → Install turns green with the first pageview.