File tree 2 files changed +49
-0
lines changed
2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ public /
Original file line number Diff line number Diff line change
1
+ # type `make help` to see all options
2
+
3
+ # To build and test the website locally, simply do:
4
+ # $ hugo
5
+ # $ hugo server
6
+
7
+ TARGET ?= upstream
8
+ BASEURL ?=
9
+
10
+ WORKTREETARGET = "$(TARGET ) /gh-pages"
11
+
12
+ ifdef BASEURL
13
+ BASEURLARG=-b $(BASEURL)
14
+ endif
15
+
16
+ all : build
17
+
18
+ .PHONY : serve html clean deploy help
19
+
20
+ .SILENT : # remove this to see the commands executed
21
+
22
+ public : # # create a worktree branch in the public directory
23
+ git worktree add -B gh-pages public $(WORKTREETARGET )
24
+ rm -rf public/*
25
+
26
+ html : public # # build the website in ./public
27
+ hugo $(BASEURLARG )
28
+ touch public/.nojekyll
29
+ echo data-apis.org > public/CNAME
30
+
31
+ public/.nojekyll : html
32
+
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
42
+
43
+
44
+ # Add help text after each target name starting with '\#\#'
45
+ help : # # Show this help.
46
+ @echo " \nHelp for this makefile"
47
+ @echo " Possible commands are:"
48
+ @grep -h " ##" $(MAKEFILE_LIST ) | grep -v grep | sed -e ' s/\(.*\):.*##\(.*\)/ \1: \2/'
You can’t perform that action at this time.
0 commit comments