diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-09-03 20:37:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-03 20:37:54 +0200 |
| commit | 388fe236c5b5666eb7ac37cd594e67354c714c2c (patch) | |
| tree | 852e53daea034c9aa34964de46f3e0187e15334c | |
| parent | 42f22a8e55fa76682b84623388a6733431bdb6ac (diff) | |
| parent | bebb0afb528636659bfb4d635acf77c4e83daa55 (diff) | |
Merge pull request #3932 from crobibero/api-doc-css
Add support for custom api-doc css
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs | 2 | ||||
| -rw-r--r-- | Jellyfin.Server/Jellyfin.Server.csproj | 9 | ||||
| -rw-r--r-- | Jellyfin.Server/Startup.cs | 1 | ||||
| -rw-r--r-- | Jellyfin.Server/wwwroot/api-docs/redoc/custom.css | 0 | ||||
| -rw-r--r-- | Jellyfin.Server/wwwroot/api-docs/swagger/custom.css | 0 |
5 files changed, 12 insertions, 0 deletions
diff --git a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs index 71c66a310..2b002c6f3 100644 --- a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs @@ -39,12 +39,14 @@ namespace Jellyfin.Server.Extensions c.DocumentTitle = "Jellyfin API"; c.SwaggerEndpoint($"/{baseUrl}api-docs/openapi.json", "Jellyfin API"); c.RoutePrefix = $"{baseUrl}api-docs/swagger"; + c.InjectStylesheet($"/{baseUrl}api-docs/swagger/custom.css"); }) .UseReDoc(c => { c.DocumentTitle = "Jellyfin API"; c.SpecUrl($"/{baseUrl}api-docs/openapi.json"); c.RoutePrefix = $"{baseUrl}api-docs/redoc"; + c.InjectStylesheet($"/{baseUrl}api-docs/redoc/custom.css"); }); } diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 6ca370d04..24ba8369a 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -64,4 +64,13 @@ <ProjectReference Include="..\Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj" /> </ItemGroup> + <ItemGroup> + <None Update="wwwroot\api-docs\swagger\custom.css"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="wwwroot\api-docs\redoc\custom.css"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> + </Project> diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 9e456de12..1a34de269 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -112,6 +112,7 @@ namespace Jellyfin.Server app.UseHttpsRedirection(); } + app.UseStaticFiles(); app.UseAuthentication(); app.UseJellyfinApiSwagger(_serverConfigurationManager); app.UseRouting(); diff --git a/Jellyfin.Server/wwwroot/api-docs/redoc/custom.css b/Jellyfin.Server/wwwroot/api-docs/redoc/custom.css new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Jellyfin.Server/wwwroot/api-docs/redoc/custom.css diff --git a/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css b/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css |
