feat: allow to specify custom jinja template
This commit is contained in:
parent
7618066b7f
commit
207204fe53
@ -14,12 +14,13 @@ def setup(
|
||||
url_prefix: str = "/oas",
|
||||
enable: bool = True,
|
||||
version_spec: Optional[str] = None,
|
||||
title_spec: Optional[str] = None
|
||||
title_spec: Optional[str] = None,
|
||||
custom_template: Optional[jinja2.Template] = None
|
||||
):
|
||||
if enable:
|
||||
oas_app = web.Application()
|
||||
oas_app["apps to expose"] = tuple(apps_to_expose) or (app,)
|
||||
oas_app["index template"] = jinja2.Template(
|
||||
oas_app["index template"] = custom_template or jinja2.Template(
|
||||
resources.read_text("aiohttp_pydantic.oas", "index.j2")
|
||||
)
|
||||
oas_app["version_spec"] = version_spec
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ title | default('Swagger UI') }}</title>
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_url | trim('/') }}/swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_url | trim('/') }}/index.css" />
|
||||
<link rel="icon" type="image/png" href="{{ static_url | trim('/') }}/favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="{{ static_url | trim('/') }}/favicon-16x16.png" sizes="16x16" />
|
||||
</head>
|
||||
|
Loading…
x
Reference in New Issue
Block a user