Is it possible to load custom sidebar HTML files natively without JavaScript? #8094
-
Hello! I'm working on customizing a documentation site and would like to know if it's possible to add custom HTML files to the sidebar natively, without using JavaScript. Specifically, I need to insert four files or HTML code in the sidebar:
I have read the customization options in the documentation (Customization Guide), but I couldn’t find a way to achieve this without JavaScript. Currently, I am using JavaScript to load these files dynamically:
Is there a way to load these files natively within MkDocs Material, without requiring JavaScript? Thanks in advance! 😊 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello @oliveira-mark,
If the above isn't specific enough to target your needed locations, there is also the option to dynamically inject logic into the templates with Python:
Some time ago, when working at Nype on the |
Beta Was this translation helpful? Give feedback.
Hello @oliveira-mark,
depends a bit on your specific case, specifically, how do you target the place where it needs to be added?
Using customization and code block overrides you can add content directly above and blow the side bar:
mkdocs-material/src/templates/base.html
Lines 294 to 334 in 0918657