on master help sign in
Makefile: gh-pages: keep history of gh-branch intact (don't drop)
121f696Markus Heiser
@@ -2,6 +2,7 @@
2
2
3export GIT_URL=https://github.com/asciimoo/searx
3export GIT_URL=https://github.com/asciimoo/searx
4export SEARX_URL=https://searx.me
4export SEARX_URL=https://searx.me
5+export DOCS_URL=https://asciimoo.github.io/searx/
5
6
6PYOBJECTS = searx
7PYOBJECTS = searx
7DOC = docs
8DOC = docs
@@ -59,6 +60,8 @@ PHONY += docs-live
59docs-live: pyenvinstall sphinx-live
60docs-live: pyenvinstall sphinx-live
60 $(call cmd,sphinx_autobuild,html,docs,docs)
61 $(call cmd,sphinx_autobuild,html,docs,docs)
61
62
63+$(GH_PAGES)::
64+ @echo "doc available at --> $(DOCS_URL)"
62
65
63# test
66# test
64# ----
67# ----
utils/makefile.sphinx+5−5
@@ -194,20 +194,20 @@ $(BOOKS_CLEAN):
194# github pages
194# github pages
195
195
196PHONY += $(GH_PAGES)
196PHONY += $(GH_PAGES)
197−$(GH_PAGES):
197+$(GH_PAGES)::
198 $(MAKE) docs
198 $(MAKE) docs
199 [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages
199 [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages
200− -cd $(GH_PAGES); git checkout --orphan gh-pages || exit 0
200+ -cd $(GH_PAGES); git checkout gh-pages >/dev/null
201− rm -rf $(GH_PAGES)/* $(GH_PAGES)/.gitignore
201+ -cd $(GH_PAGES); ls -A | grep -v '.git$$' | xargs rm -rf
202− touch $(GH_PAGES)/.nojekyll ;\
203 cp -r $(DOCS_DIST)/* $(GH_PAGES)/
202 cp -r $(DOCS_DIST)/* $(GH_PAGES)/
203+ touch $(GH_PAGES)/.nojekyll
204 echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
204 echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
205− -cd $(GH_PAGES); git push origin :gh-pages
206 cd $(GH_PAGES);\
205 cd $(GH_PAGES);\
207 git add --all . ;\
206 git add --all . ;\
208 git commit -m "gh-pages: updated" ;\
207 git commit -m "gh-pages: updated" ;\
209 git push origin gh-pages
208 git push origin gh-pages
210
209
210+
211PHONY += docs-clean
211PHONY += docs-clean
212docs-clean: $(BOOKS_CLEAN)
212docs-clean: $(BOOKS_CLEAN)
213 $(call cmd,sphinx_clean)
213 $(call cmd,sphinx_clean)