Skip to content

Commit 2ea0393

Browse files
authored
Merge pull request #94 from uvulpos/feat/add-custom-scripts-to-swaggerui-template
Add custom scripts to swagger-ui template
2 parents 503230c + e7bf351 commit 2ea0393

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ type Config struct {
179179
// Applies custom CSS styles.
180180
// default: ""
181181
CustomStyle template.CSS `json:"-"`
182+
183+
// Applies custom JavaScript scripts.
184+
// default ""
185+
CustomScript template.JS `json:"-"`
182186
}
183187

184188
type FilterConfig struct {

index.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const indexTmpl string = `
1717
{{.CustomStyle}}
1818
</style>
1919
{{- end}}
20+
{{- if .CustomScript}}
21+
<script>
22+
{{.CustomScript}}
23+
</script>
24+
{{- end}}
2025
</head>
2126
<body>
2227
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0">

0 commit comments

Comments
 (0)