-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
37 lines (28 loc) · 1.24 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
SHELL := bash
TARGET ?= origin
# hpy static page and blog makefile
# type `make help` to see all options
PYTHON := python3
all: build
.PHONY: clean build help
venv_nikola/bin/nikola: ## create a virtualenv to build the website
@virtualenv -p $(PYTHON) ./venv_nikola
@venv_nikola/bin/python -m pip install -r requirements.txt
@venv_nikola/bin/nikola plugin -i sidebar
@venv_nikola/bin/nikola plugin -i localsearch
build: venv_nikola/bin/nikola ## build the website if needed, the result is in ./public
venv_nikola/bin/nikola build
@for f in $$(grep "include.*sidebar-en.inc" -lr public/) ;do \
sed -i -e'/<!-- include sidebar-en.inc -->/r public/sidebar-en.inc' $$f; \
sed -i -e'/<!-- include sidebar-en.inc -->/d' $$f; \
echo $${f}; \
done;
auto: venv_nikola/bin/nikola ## build and serve the website, autoupdate on changes
venv_nikola/bin/nikola auto -a 0.0.0.0
clean: venv_nikola/bin/nikola ## clean the website, usually not needed at all
venv_nikola/bin/nikola clean
# Add help text after each target name starting with '\#\#'
help: ## Show this help.
@echo "\nHelp for building the website, based on nikola"
@echo "Possible commands are:"
@grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\(.*\):.*##\(.*\)/ \1: \2/'