-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (54 loc) · 2.11 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
.PHONY:
server chroma papermod instantpage update debug-make-posts debug-delete-posts new-%
server:
hugo server -D --disableFastRender --ignoreCache
chroma:
hugo gen chromastyles --style=monokai > ./assets/css/chroma/chroma_dark.css
hugo gen chromastyles --style=monokailight > ./assets/css/chroma/chroma_light.css
sed -i 's/.chroma/.dark .chroma/g' ./assets/css/chroma/chroma_dark.css
python chroma.py
submodule:
git submodule update --remote --merge
goatcounter:
curl https://gc.zgo.at/count.js -o ./assets/js/goatcounter.js
instantpage:
git clone git@github.com:instantpage/instant.page.git tmp/instant.page && \
cd ./tmp/instant.page && \
npm install uglify-js && \
npx --yes uglifyjs ./instantpage.js --compress --mangle --toplevel --output ./instantpage.min.js && \
sed -i '1s/^/\n\/\*\n\n/' LICENSE && \
echo -e "\n*/" >> LICENSE && \
cat LICENSE >> ./instantpage.min.js && \
cp ./instantpage.min.js ./../../assets/js/instantpage.js && \
cd ./../../ && \
rm -rf ./tmp
katex:
mkdir tmp && \
cd tmp && \
curl -L https://github.com/KaTeX/KaTeX/releases/latest/download/katex.zip -o ./katex.zip && \
unzip ./katex.zip && \
cd ./katex && \
cp ./fonts/* ./../../static/assets/css/fonts && \
mkdir -p ./../../assets/js/katex/contrib && \
mkdir -p ./../../assets/css/katex/ && \
cp ./katex.min.js ./../../assets/js/katex/katex.min.js && \
cp ./contrib/auto-render.min.js ./../../assets/js/katex/contrib/auto-render.min.js && \
cp ./contrib/copy-tex.min.js ./../../assets/js/katex/contrib/copy-tex.min.js && \
cp ./contrib/mhchem.min.js ./../../assets/js/katex/contrib/mhchem.min.js && \
cp ./katex.min.css ./../../assets/css/katex/katex.min.css && \
cd ./../../ && \
rm -rf ./tmp
mermaid:
curl https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js -o ./assets/js/mermaid.min.js
update: submodule goatcounter instantpage katex mermaid
debug-make-posts:
for i in `seq 0 1 50`; do\
hugo new posts/__test_$$i.md;\
done
debug-delete-posts:
for i in `seq 0 1 50`; do\
rm ./content/posts/__test_$$i.md;\
done
# Thanks: http://puni56.net/posts/makefile-arg/
new-%:
hugo new posts/${@:new-%=%}/index.md