Skip to content

Commit

Permalink
Merge pull request #94 from uvulpos/feat/add-custom-scripts-to-swagge…
Browse files Browse the repository at this point in the history
…rui-template

Add custom scripts to swagger-ui template
  • Loading branch information
ReneWerner87 authored Jul 4, 2024
2 parents 503230c + e7bf351 commit 2ea0393
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ type Config struct {
// Applies custom CSS styles.
// default: ""
CustomStyle template.CSS `json:"-"`

// Applies custom JavaScript scripts.
// default ""
CustomScript template.JS `json:"-"`
}

type FilterConfig struct {
Expand Down
5 changes: 5 additions & 0 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const indexTmpl string = `
{{.CustomStyle}}
</style>
{{- end}}
{{- if .CustomScript}}
<script>
{{.CustomScript}}
</script>
{{- end}}
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0">
Expand Down

0 comments on commit 2ea0393

Please sign in to comment.