-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (37 loc) · 927 Bytes
/
Makefile
File metadata and controls
47 lines (37 loc) · 927 Bytes
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
include common.mk
# Makefile for Website and Blog
define success
@tput setaf 2; \
echo ""; \
owls="🦉 🦆 🦢 🐦 🦜"; \
n=$$(expr $$(od -An -N2 -tu2 /dev/urandom | tr -d ' ') % 5 + 1); \
owl=$$(echo $$owls | cut -d' ' -f$$n); \
printf "%s > \033[33m%s\033[0m completed [OK]\n" "$$owl" "$(@)"; \
tput sgr0;
endef
.PHONY: preview clean clean_venv html
# Website preview
preview: html html html html
python3 -m http.server
$(call success)
# Blog targets
SRCDIR=./blogsrc
OUTPUTDIR=./blog
CONFFILE=$(SRCDIR)/pelicanconf.py
PUBLISHCONF=$(SRCDIR)/publishconf.py
venv:
python3 -m venv venv
. venv/bin/activate && \
pip install -r $(SRCDIR)/requirements.txt
$(call success)
cleanblog:
rm -rf blog/
mkdir blog/
$(call success)
clean: cleanblog clean_venv
clean_venv:
rm -rf venv
html: cleanblog venv
. venv/bin/activate && \
pelican $(SRCDIR)/content -o $(OUTPUTDIR) -s $(CONFFILE)
$(call success)