-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
38 lines (33 loc) · 1.04 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
# hugo version: 0.109
rebuild:
@echo "Cleaning up"
@rm -rf public/*
@make build
run:
@hugo server --buildDrafts --buildExpired --buildFuture --disableKinds=RSS --noTimes
build:
@echo "Building"
@hugo
publish:
@make rebuild
@echo "Publishing"
@git log --oneline | head -n1 | sed -r 's/^[a-zA-Z0-9]+ //g' > public/last_commit
@git checkout main
@git pull --rebase
@rm -rf *.html *.xml 2* about* page tags series stylesheets images avatar javascripts resources content
@for i in $(find . -path ./public -prune -o -name index.html); do rm -rf $(dirname $i); done
@cp -R public/* .
@rm -rf public
@git add -A .
@git commit -m "Last commit from source branch: '`cat last_commit`'"
@rm -rf last_commit
@git push
@git checkout -
drafts:
@egrep "draft.*true" content/posts/ -rl | grep "\.md"
roam:
mkdir -p roam-export
unzip $(filter-out $@,$(MAKECMDGOALS)) -d roam-export/
for i in roam-export/blog/*; do sed -i "s/^..//; 1i+++\ntitle = \"Podcasts\"\ntags = [\"english\"]\n+++" $$i; done
mv roam-export/blog/*.md content/
rm -rf roam-export