Skip to content

Commit 09f2da9

Browse files
committed
Update makefile
1 parent da2ab03 commit 09f2da9

File tree

1 file changed

+24
-42
lines changed

1 file changed

+24
-42
lines changed

Makefile

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,37 @@
1-
# type `make help` to see all options
1+
HTMLDIR=public
2+
USERNAME=rgommers
23

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 ?=
95

106
ifdef BASEURL
11-
BASEURLARG=-b $(BASEURL)
12-
endif
7+
BASEURLARG=-b $(BASEURL)
8+
endif
139

14-
all: build
10+
.PHONY: help clean html
1511

16-
.PHONY: serve html clean deploy help
1712

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"
1917

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)
2220

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
2628

27-
html: public ## build the website in ./public
29+
html: ## build the website in ./public
2830
hugo $(BASEURLARG)
29-
touch public/.nojekyll
30-
31-
public/.nojekyll: html
3231

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
4234

43-
hugo: ## for local development
44-
hugo $(BASEURLARG)
4535

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

Comments
 (0)