summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: e0460280ad235cee93245142765d665156633af5 (plain)
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
# _writing is the authoring workspace, not part of the site, so it is pruned
# rather than compressed alongside the pages that actually get served.
SRC_FILES := $(shell find . -path ./_writing -prune -o -type f \( -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.md" \) -print)
GZ_FILES  := $(SRC_FILES:=.gz)

# The deploy hook runs this on the server, which has no Node. Generated blog
# files are committed, so all the server has to do is compress them.
all: $(GZ_FILES)

# Regenerate post pages, the blog index and the feed from _writing/posts.
# Authoring machines only — run it before committing, never on the server.
blog:
	node _writing/build.mjs

# Open the writing desk: draft on the left, live preview on the right.
write:
	node _writing/serve.mjs

# Render drafts too, into _writing/.preview, which is never committed.
preview:
	node _writing/build.mjs --drafts

%.gz: %
	gzip -k -f $<

clean:
	rm -f $(GZ_FILES)

.PHONY: all blog write preview clean