-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
50 lines (39 loc) · 1.04 KB
/
Copy pathmakefile
File metadata and controls
50 lines (39 loc) · 1.04 KB
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
# zola version: 0.22
rebuild:
@echo "Cleaning up"
@rm -rf public/*
@make build
run:
@zola serve --drafts
build:
@echo "Building"
@zola build
# Files that live on main only and must survive a publish
KEEP := ':(exclude)CNAME' ':(exclude).nojekyll' ':(exclude).gitignore' ':(exclude)README.markdown'
publish:
@make rebuild
@echo "Publishing"
@msg="$$(git log -1 --format=%s)"; \
git checkout main || exit 1; \
{ \
git pull --rebase && \
git rm -r -q -f --ignore-unmatch -- . $(KEEP) && \
cp -R public/. . && \
git add -A . && \
if git diff --cached --quiet; then \
echo "Nothing to publish"; \
else \
git commit -q -m "Last commit from source branch: '$$msg'" && git push; \
fi; \
}; \
status=$$?; \
git checkout -; \
exit $$status
drafts:
@egrep "draft.*true" content/posts/ -rl | grep "\.md"
places:
@echo "Syncing places from Obsidian"
@cp ~/obsidian/second-brain/NotHix/Places/*.md content/places/
@rm -f content/places/_readme.md
notes: places
@cp ~/obsidian/second-brain/NotHix/pothix.com/pages/*.md content/pages/