Skip to content
Discussion options

You must be logged in to vote

When you put the CSS into docs/ then it gets deployed to your site, while files outside docs/ do not. The extra_css configuration option does not result in extra files being deployed but just leads to a link being inserted in the HTML that loads the CSS. If you want to keep your CSS, JS or other files outside the docs/ folder then you need to also get MkDocs to copy them over to your site.

It turns out that the static_templates option is not needed for CSS and JS, so this should be enough:

theme:
  name: material
  custom_dir: assets

extra_css:
  - stylesheets/extra.css

Now, create a folder assets in your project root and inside that stylesheets, then copy/move your extra.css there.

Replies: 2 comments 3 replies

Comment options

alexvoss
Mar 21, 2024
Collaborator Sponsor

You must be logged in to vote
3 replies
@ghost
Comment options

@kamilkrzyskow
Comment options

@alexvoss
Comment options

alexvoss Mar 21, 2024
Collaborator Sponsor

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants