Skip to content

Commit

Permalink
move swagger-ui to webpack/npm (go-gitea#9714)
Browse files Browse the repository at this point in the history
Created a second webpack output file for swagger-ui which is loaded on
the /api/swagger route. One notable difference is the absence of the
swagger favicon that was previously used which is now the gitea icon. I
see no easy way to restore that favicon, so I decided to not keep it.
  • Loading branch information
silverwind authored and techknowlogick committed Jan 14, 2020
1 parent 44de66b commit f00961a
Show file tree
Hide file tree
Showing 19 changed files with 875 additions and 462 deletions.
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,6 @@ $(CSS_DEST): node_modules $(CSS_SOURCES)
$(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/*

.PHONY: swagger-ui
swagger-ui:
rm -Rf public/vendor/assets/swagger-ui
git clone --depth=10 -b v3.13.4 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
mv $(TMPDIR)/swagger-ui/dist public/vendor/assets/swagger-ui
rm -Rf $(TMPDIR)/swagger-ui
$(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../../swagger.v1.json;g" public/vendor/assets/swagger-ui/index.html

.PHONY: update-translations
update-translations:
mkdir -p ./translations
Expand Down
Loading

0 comments on commit f00961a

Please sign in to comment.