Skip to content

Commit 4f57e27

Browse files
committed
fix: fix static path reference
1 parent f1d0da2 commit 4f57e27

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

src/apispec_ui/swagger-ui/index.html

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>{{ title }}</title>
6-
<link rel="stylesheet" type="text/css" href="{{ swagger_static }}/swagger-ui.css"/>
6+
<link rel="stylesheet" type="text/css"
7+
href="{{ url_for('swagger.static', filename='swagger-ui.css') }}"/>
78
<link rel="icon" href="{{ favicon }}" sizes="64x64 32x32 16x16"/>
89
<style>
910
html {
@@ -26,31 +27,32 @@
2627
</head>
2728

2829
<body>
29-
<div id="swagger-ui"></div>
30-
31-
<script src="{{ swagger_static }}/swagger-ui-bundle.js" charset="UTF-8"></script>
32-
<script src="{{ swagger_static }}/swagger-ui-standalone-preset.js"
33-
charset="UTF-8"></script>
34-
<script>
35-
window.onload = function () {
36-
const ui = SwaggerUIBundle({
37-
url: "{{ url }}",
38-
dom_id: "#swagger-ui",
39-
deepLinking: true,
40-
presets: [
41-
SwaggerUIBundle.presets.apis,
42-
SwaggerUIStandalonePreset
43-
],
44-
plugins: [
45-
SwaggerUIBundle.plugins.DownloadUrl
46-
],
47-
{% if not swagger_hide_bar %}
30+
<div id="swagger-ui"></div>
31+
<script src="{{ url_for('swagger.static', filename='swagger-ui-bundle.js') }}"
32+
charset="UTF-8"></script>
33+
<script
34+
src="{{ url_for('swagger.static', filename='swagger-ui-standalone-preset.js') }}"
35+
charset="UTF-8"></script>
36+
<script>
37+
window.onload = function () {
38+
const ui = SwaggerUIBundle({
39+
url: "{{ url }}",
40+
dom_id: "#swagger-ui",
41+
deepLinking: true,
42+
presets: [
43+
SwaggerUIBundle.presets.apis,
44+
SwaggerUIStandalonePreset
45+
],
46+
plugins: [
47+
SwaggerUIBundle.plugins.DownloadUrl
48+
],
49+
{% if not swagger_hide_bar %}
4850
layout: "StandaloneLayout"
49-
{% endif %}
50-
});
51+
{% endif %}
52+
});
5153

52-
window.ui = ui;
53-
};
54-
</script>
54+
window.ui = ui;
55+
};
56+
</script>
5557
</body>
5658
</html>

0 commit comments

Comments
 (0)