introduce hot reload for docs

This commit is contained in:
Willy Kloucek
2021-03-01 15:06:00 +01:00
parent 387b2f3272
commit 083b39ef17
13 changed files with 95 additions and 47 deletions
+2 -1
View File
@@ -1 +1,2 @@
hugo/
hugo/
mutagen.yml.lock
+32 -19
View File
@@ -10,29 +10,42 @@ help:
docs-generate: ## run docs-generate for all oCIS extensions
@$(MAKE) --no-print-directory -C ../ docs-generate
.PHONY: config-docs-generate
config-docs-generate: ## run config-docs-generate for all oCIS extensions
@$(MAKE) --no-print-directory -C ../ config-docs-generate
.PHONY: docs-copy
docs-copy: ## copy docs to hugo
.PHONY: docs-init
docs-init:
@mkdir -p hugo/content/
@cd hugo; \
git init; \
git config advice.detachedHead false; \
git remote rm origin; \
git remote add origin https://github.com/owncloud/owncloud.github.io; \
git fetch --depth=1; \
git checkout origin/source -f; \
rsync -ax --delete --exclude hugo/ --exclude Makefile --exclude .gitignore --exclude README.md ../. content/; \
@cd hugo && git init
@cd hugo && git config advice.detachedHead false
@cd hugo && git remote rm origin || true
@cd hugo && git remote add origin https://github.com/owncloud/owncloud.github.io
@cd hugo && git fetch --depth=1
@cd hugo && git checkout origin/source -f
.PHONY: docs-serve
docs-serve: $(HUGO) docs-generate docs-copy ## serve docs with hugo
cd hugo && $(HUGO) server
docs-serve: docs-init docs-generate docs-copy ## serve docs with hugo
@bash -c "trap 'trap - SIGINT SIGTERM ERR; $(MAKE) --no-print-directory docs-sync-stop; exit 0' SIGINT SIGTERM ERR; $(MAKE) --no-print-directory docs-sync-start && $(MAKE) --no-print-directory hugo-serve"
.PHONY: test
test: $(HUGO)
@cd hugo && $(HUGO)
.PHONY: docs-serve-simple
docs-serve-simple: $(HUGO) config-docs-generate docs-copy ## serve docs with hugo without protobuf generation
cd hugo && $(HUGO) server
.PHONY: hugo-serve
hugo-serve: $(HUGO)
@cd hugo && $(HUGO) server
.PHONY: docs-copy
docs-copy: docs-init docs-sync-start docs-sync-stop
.PHONY: docs-sync-start
docs-sync-start: $(MUTAGEN)
@$(MUTAGEN) project terminate || true
@$(MUTAGEN) daemon stop || true
@$(MUTAGEN) project start
@$(MUTAGEN) project flush
.PHONY: docs-sync-stop
docs-sync-stop: $(MUTAGEN)
@$(MUTAGEN) project terminate
@$(MUTAGEN) daemon stop
.PHONY: clean
clean: ## clean up docs build artifacts
+14
View File
@@ -0,0 +1,14 @@
sync:
docs:
mode: one-way-replica
alpha: .
beta: ./hugo/content
flushOnCreate: true
ignore:
paths:
- .gitignore
- mutagen.yml
- mutagen.yml.lock
- hugo
- README.md
- Makefile