|
1 |
| -# type `make help` to see all options |
| 1 | +HTMLDIR=public |
| 2 | +USERNAME=rgommers |
2 | 3 |
|
3 |
| -# If you have naively forked this repo, say to |
4 |
| -# github.com://myname/numpy.org.git, you can test out the build via |
5 |
| -# make TARGET=myname BASEURL=https://myname.github.io/numpy.org deploy |
6 |
| - |
7 |
| -TARGET ?= origin |
8 |
| -BASEURL ?= |
| 4 | +BASEURL ?= |
9 | 5 |
|
10 | 6 | ifdef BASEURL
|
11 |
| - BASEURLARG=-b $(BASEURL) |
12 |
| -endif |
| 7 | + BASEURLARG=-b $(BASEURL) |
| 8 | +endif |
13 | 9 |
|
14 |
| -all: build |
| 10 | +.PHONY: help clean html |
15 | 11 |
|
16 |
| -.PHONY: serve html clean deploy help |
17 | 12 |
|
18 |
| -.SILENT: # remove this to see the commands executed |
| 13 | +help: |
| 14 | + @echo "Please use \`make <target>' where <target> is one of" |
| 15 | + @echo " upload USERNAME=user to upload the generated pages to scipy.org" |
| 16 | + @echo " html to make standalone HTML files" |
19 | 17 |
|
20 |
| -serve: public ## serve the website |
21 |
| - hugo --i18n-warnings server -D |
| 18 | +clean: ## remove the build artifacts, mainly the "public" directory |
| 19 | + rm -rf $(HTMLDIR) |
22 | 20 |
|
23 |
| -public: ## create a worktree branch in the public directory |
24 |
| - git worktree add -B gh-pages public $(TARGET)/gh-pages |
25 |
| - rm -rf public/* |
| 21 | +upload: html |
| 22 | + # SSH must be correctly configured for this to work. |
| 23 | + # cp .htaccess $(HTMLDIR) |
| 24 | + chmod -R a+rX $(HTMLDIR) |
| 25 | + rsync -og --chown=www-data:www-data --delete-after -r \ |
| 26 | + --exclude '.git' $(HTMLDIR) \ |
| 27 | + $(USERNAME)@scipy.org:/var/www/html |
26 | 28 |
|
27 |
| -html: public ## build the website in ./public |
| 29 | +html: ## build the website in ./public |
28 | 30 | hugo $(BASEURLARG)
|
29 |
| - touch public/.nojekyll |
30 |
| - |
31 |
| -public/.nojekyll: html |
32 | 31 |
|
33 |
| -clean: ## remove the build artifacts, mainly the "public" directory |
34 |
| - rm -rf public |
35 |
| - git worktree prune |
36 |
| - rm -rf .git/worktrees/public |
37 |
| - |
38 |
| -deploy: public/.nojekyll ## push the built site to the gh-pages of this repo |
39 |
| - cd public && git add --all && git commit -m"Publishing to gh-pages" |
40 |
| - @echo pushint to $(TARGET) gh-pages |
41 |
| - git push $(TARGET) gh-pages |
| 32 | +serve: |
| 33 | + @hugo --i18n-warnings --buildDrafts server |
42 | 34 |
|
43 |
| -hugo: ## for local development |
44 |
| - hugo $(BASEURLARG) |
45 | 35 |
|
46 |
| -# Add help text after each target name starting with '\#\#' |
47 |
| -help: ## Show this help. |
48 |
| - @echo "\nHelp for this makefile" |
49 |
| - @echo "Possible commands are:" |
50 |
| - @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\(.*\):.*##\(.*\)/ \1: \2/' |
51 |
| - @echo |
52 |
| - @echo If you have naively forked this repo, say to |
53 |
| - @echo github.com://myname/numpy.org.git, you can test out the build via |
54 |
| - @echo make TARGET=myname BASEURL=https://myname.github.io/numpy.org deploy |
55 |
| - |
| 36 | +serve-dev: |
| 37 | + @hugo --i18n-warnings --buildDrafts server --disableFastRender |
0 commit comments