Skip to content

Commit b92a5d8

Browse files
sapkGitea
and
Gitea
authored
release docs as an archive (#12243)
* release docs along sources * use a custom offline version Co-authored-by: Gitea <gitea@fake.local>
1 parent 633f52c commit b92a5d8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
524524
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
525525

526526
.PHONY: release
527-
release: frontend generate release-windows release-linux release-darwin release-copy release-compress release-sources release-check
527+
release: frontend generate release-windows release-linux release-darwin release-copy release-compress release-sources release-docs release-check
528528

529529
$(DIST_DIRS):
530530
mkdir -p $(DIST_DIRS)
@@ -580,6 +580,17 @@ release-sources: | $(DIST_DIRS) node_modules
580580
tar --exclude=./$(DIST) --exclude=./.git --exclude=./$(MAKE_EVIDENCE_DIR) --exclude=./node_modules/.cache -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
581581
rm -f $(STORED_VERSION_FILE)
582582

583+
.PHONY: release-docs
584+
release-docs: | $(DIST_DIRS) docs
585+
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
586+
587+
.PHONY: docs
588+
docs:
589+
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
590+
GO111MODULE=off $(GO) get -u github.com/gohugoio/hugo; \
591+
fi
592+
cd docs; make trans-copy clean build-offline;
593+
583594
node_modules: package-lock.json
584595
npm install --no-save
585596
@touch node_modules

docs/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ server: $(THEME)
2121
build: $(THEME)
2222
hugo --cleanDestinationDir
2323

24+
.PHONY: build-offline
25+
build-offline: $(THEME)
26+
hugo --baseURL="/" --cleanDestinationDir
27+
2428
.PHONY: update
2529
update: $(THEME)
2630

0 commit comments

Comments
 (0)