-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
55 lines (44 loc) · 1.4 KB
/
Copy pathmakefile
File metadata and controls
55 lines (44 loc) · 1.4 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
47
48
49
50
51
# zola version: 0.23
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"
# The vault is the source of truth. Notes there use plain [Foo](foo.md)
# links so Obsidian can resolve them; Zola needs its own @/ form, which
# would resolve against /places/<slug>/ and 404 if left as a bare path.
# Links already written as @/... are skipped by the pattern.
places:
@echo "Syncing places from Obsidian"
@cp ~/obsidian/second-brain/NotHix/Places/*.md content/places/
@rm -f content/places/_readme.md
@sed -i '' -E 's|\]\(([a-z0-9-]+)\.md\)|](@/places/\1.md)|g' content/places/*.md
notes: places
@cp ~/obsidian/second-brain/NotHix/pothix.com/pages/*.md content/pages/