-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
40 lines (31 loc) · 1.18 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
.PHONY: help prepare teams teams-clean html serve clean
.DEFAULT_GOAL := help
# Add help text after each target name starting with '\#\#'
help: ## show this help
@echo -e "Help for this makefile\n"
@echo "Possible commands are:"
@grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\(.*\):.*##\(.*\)/ \1: \2/'
prepare:
git submodule update --init --recursive
pre-commit install || echo "Install 'pre-commit' in a Python environment with: 'pip install pre-commit'"
hugo version || echo "Install Hugo from: https://gohugo.io"
TEAMS_DIR = content/about
TEAMS = blog-editor-in-chief blog-editors blog-reviewers
TEAMS_QUERY = python themes/scientific-python-hugo-theme/tools/team_query.py
$(TEAMS_DIR)/%.toml:
$(TEAMS_QUERY) --org scientific-python --team "$*" > $(TEAMS_DIR)/$*.toml
teams-clean:
for team in $(TEAMS); do \
rm -f $(TEAMS_DIR)/$${team}.toml ;\
done
teams: ## generates team gallery pages
teams: | teams-clean $(patsubst %,$(TEAMS_DIR)/%.toml,$(TEAMS))
html: ## Build site in `./public`
html: prepare
hugo
serve: ## Serve site, typically on http://localhost:1313
serve: prepare
@hugo --printI18nWarnings server
clean: ## Remove built files
clean:
rm -rf public