diff --git a/demo-mkdocs/docs/demo/nocache.md b/demo-mkdocs/docs/demo/nocache.md new file mode 100644 index 0000000..ae83eaa --- /dev/null +++ b/demo-mkdocs/docs/demo/nocache.md @@ -0,0 +1,13 @@ +Disable browser cache. + +## Markdown + +```html + + +``` + +## Swagger UI + + + diff --git a/mkdocs_swagger_ui_tag/plugin.py b/mkdocs_swagger_ui_tag/plugin.py index cd63232..0c9e8b2 100644 --- a/mkdocs_swagger_ui_tag/plugin.py +++ b/mkdocs_swagger_ui_tag/plugin.py @@ -177,6 +177,7 @@ def render_template(openapi_spec_url, swagger_ui_ele): css_dir=css_dir, extra_css_files=extra_css_files, js_dir=js_dir, + nocache=swagger_ui_ele.has_attr("nocache"), background=self.config["background"], id="{{ID_PLACEHOLDER}}", # ID is unknown yet - it's the hash of the content. openapi_spec_url=openapi_spec_url, diff --git a/mkdocs_swagger_ui_tag/swagger-ui/swagger.html b/mkdocs_swagger_ui_tag/swagger-ui/swagger.html index 2530dbc..bdd5752 100644 --- a/mkdocs_swagger_ui_tag/swagger-ui/swagger.html +++ b/mkdocs_swagger_ui_tag/swagger-ui/swagger.html @@ -17,6 +17,25 @@