-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (79 loc) · 2.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
services = $(addprefix services/,$(patsubst %.yaml,%,$(notdir $(wildcard ./data/oniontree/unsorted/*.yaml))))
tags = $(addprefix tags/,$(addsuffix .html,$(notdir $(wildcard ./data/oniontree/tagged/*))))
HUGO_OUTPUT_PATH = ./public/
HUGO_ENVIRONMENT = onion
HUGO = hugo -c "./content" -d "$(HUGO_OUTPUT_PATH)" --environment "$(HUGO_ENVIRONMENT)"
.PHONY: all
all:
.PHONY: build
build: build/content/index \
build/content/services \
build/content/services/index \
build/content/tags \
build/content/tags/index \
build/content/download \
build/content/news/index
@$(HUGO)
.PHONY: build/content/index
build/content/index: _index.html
_index.html:
@$(HUGO) new --kind homepage "$@"
##
### Services
##
.PHONY: build/content/services
build/content/services: $(addsuffix .html,$(services))
services/%.html:
@$(HUGO) new --kind service "$@"
.PHONY: build/content/services/index
build/content/services/index: services/_index.html
services/_index.html:
@$(HUGO) new --kind services "$@"
##
### News
##
.PHONY: build/content/news/index
build/content/news/index: news/_index.html
news/_index.html:
@$(HUGO) new --kind news "$@"
##
### OnionTree Bookmarks
##
.PHONY: build/content/bookmarks
build/content/bookmarks: bookmarks.html
bookmarks.html:
@$(HUGO) new --kind bookmarks "$@"
.PHONY: build/content/download
build/content/download: download.html
download.html:
@$(HUGO) new --kind download "$@"
##
### Tags
##
.PHONY: build/content/tags
build/content/tags: $(tags)
tags/%.html:
@$(HUGO) new --kind tag "$@"
.PHONY: build/content/tags/index
build/content/tags/index: tags/_index.html
tags/_index.html:
@$(HUGO) new --kind tags "$@"
##
## Miscellaneous
##
.PHONY: download
download:
dst=$$(mktemp -d) && git clone https://github.com/onionltd/oniontree "$$dst" \
&& rsync -avzh --include "*.yaml" --exclude ".*" --exclude "*.*" "$$dst/" data/oniontree/
.PHONY: purge
purge: clean
$(RM) -r data/oniontree/*
.PHONY: clean
clean:
$(RM) content/_index.html
$(RM) content/download.html
$(RM) content/bookmarks.html
$(RM) -r content/services/
$(RM) -r content/tags/
$(RM) -r content/news/
$(RM) -r public/*