Files
gitea-docs/Makefile
TheFox0x7 e3cc4ec689 update api docs (#297)
script is now standalone instead of being CI only.
Added a post 1.25 rule for templates since the variables in template changed after https://gitea.com/gitea/gitea-mirror/commit/3533263ced8
Fixes: https://github.com/go-gitea/gitea/issues/35964

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/docs/pulls/297
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
2025-11-23 18:43:58 +00:00

59 lines
1.3 KiB
Makefile

export NODE_OPTIONS := "--max-old-space-size=8192"
GITEA_AWESOME_REMOTE := https://gitea.com/gitea/awesome-gitea.git
GITEA_AWESOME_BRANCH := main
.PHONY: all
all: build
.PHONY: create_dir
create_dir:
mkdir -p .tmp
.PHONY: clone_awesome
clone_awesome: create_dir
git clone --branch=$(GITEA_AWESOME_BRANCH) $(GITEA_AWESOME_REMOTE) .tmp/upstream-awesome || true
.PHONY: prepare-awesome-latest
prepare-awesome-latest: clone_awesome
cp .tmp/upstream-awesome/README.md docs/awesome.md
.PHONY: prepare-awesome\#%
prepare-awesome\#%:
cp .tmp/upstream-awesome/README.md versioned_docs/version-1.$*/awesome.md
.PHONY: install
install:
npm install
.PHONY: prepare-docs
prepare-docs: install prepare-awesome-latest prepare-awesome\#19 prepare-awesome\#20 prepare-awesome\#21 prepare-awesome\#22 prepare-awesome\#23 prepare-awesome\#24
.PHONY: build
build:
npm run build
.PHONY: serve
serve: prepare-docs
npm run start
.PHONY: serve-zh
serve-zh: prepare-docs
npm run start -- --locale zh-cn
.PHONY: clean
clean:
rm -rf .tmp
rm -rf static/_*
rm -rf static/swagger-latest.json
rm -rf static/swagger-19.json
rm -rf static/swagger-20.json
rm -rf static/swagger-21.json
rm -rf static/swagger-22.json
rm -rf static/swagger-23.json
rm -rf static/swagger-24.json
.PHONY: update-api-docs
update-api-docs:
./update_api_docs.sh