Closed Uzlopak closed 1 year ago
Can you include one or two examples of what can be achieved with this themes?
Can the logo at the top left be replaced?
The Logo is an image and that image is the 64x64 favicon. So the answer is yes, but on the other hand also kind of not that "clever" as it is not possible to completely theme the swagger documentation.
Maybe it makes more sense to have a theme option which basically mounts a folder with fastify-static to /static/theme
. And we basically expect that the theme folder contains a index.css with the overriding css or maybe index.html overriding everything. Benefit of that would be, that an implementer could put all files into the theme-folder, reducing the configuration overhead and be in full controle of the output.
I think that would be better.
Mounting the theme folder seems to be elegant, but then it is not easy to just hook those swagger-themes.
Let's land this and see. Tests are failihg
I will probably implement it tomorrow
As support for the swagger-themes library will be added, please write. I will update the library documentation.
Are there any successes?
Closes #13 Closes #35 Closes #38
First we should discuss if the approach is OK or not. So basically I introduce a theme option. The theme option can handle additional javascript, additional css files and additional favicons. See the corresponding typescript interface. I guess we need also to calculate the CSP of the files on plugin load, which is not yet implemented but should be a no-brainer.
So lets discuss if it is the right approach.
So for the request of @OkanPinar in #35 you would do:
Taking the example of @Xpucmoc-Bockpec for #13
Checklist
npm run test
andnpm run benchmark