I have written some custom CSS I would like to be included in a Mkdocs site hosted by ReadTheDocs. It is not working because RTD isn't serving the CSS file.
I have a .readthedocs.yml
file that asks RTD to use Mkdocs:
version: 2
mkdocs:
configuration: .mkdocs.yml
My .mkdocs.yml
file references the fact that I'm using a custom CSS file:
docs_dir: my-docs-directory
theme:
name: 'material'
extra_css:
- '.mkdocs.material.css'
ReadTheDocs reports that the docs built fine, but when I load them the custom CSS isn't in effect. If I open the browser Console I see this error:
Refused to apply style from 'https://private-site.readthedocs-hosted.com/en/latest/.mkdocs.material.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
If I open the CSS file URL in its own tab I see a "404 - Not found" page.
I tried including the CSS file in both root (where .readthedocs.yml
and .mkdocs.yml
live) and in my docs directory (my-docs-directory
), but neither work.
I think I need RTD to somehow know to serve the CSS file up as a static file, but all guidelines I could find about this are specific to Sphinx.
Please help! Thanks!