~jleightcap/jleightcap.srht.site

ref: 305731df3eec595d645cf04c700eb0632038f77d jleightcap.srht.site/Makefile -rw-r--r-- 1.2 KiB
305731dfjleightcap dedup rss post 6 months ago
                                                                                
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
SRCS = $(wildcard blog/*.md) $(wildcard project/*.md)
HTML = $(patsubst blog/%.md, blog/%.html, $(SRCS)) \
	   $(patsubst project/%.md, project/%.html, $(SRCS)) \
	   index.html
GMNI = $(patsubst blog/%.md, blog/%.gmi, $(SRCS)) \
	   $(patsubst project/%.md, project/%.gmi, $(SRCS)) \

GMNISITE = gemini:\/\/jleightcap.srht.site

.PHONY: all
all: $(HTML) $(GMNI)

.PHONY: exifremove
exifremove:
	exiftool -all= static/*.jpg static/*.jpeg static/*.png

.PHONY: imgoptimize
imgoptimize:
	jpegoptim -S 1000 static/*.{jpg,jpeg}
	optipng -strip all -o3 static/*.{png,gif}

index.html: index.md
	hhtml -h < $< > $@
	sed -i 's/EXT/html/g' $@
	sed -i 's/GMILINK/$(GMNISITE)\/$(subst .md,.gmi,$(notdir $<))/g' $@

project/%.html: project/%.md
	hhtml -h < $< > $@
	sed -i 's/EXT/html/g' $@
	sed -i 's/GMILINK/$(GMNISITE)\/project\/$(subst .md,.gmi,$(notdir $<))/g' $@

blog/%.html: blog/%.md
	hhtml -h < $< > $@
	sed -i 's/EXT/html/g' $@
	sed -i 's/GMILINK/$(GMNISITE)\/blog\/$(subst .md,.gmi,$(notdir $<))/g' $@

project/%.gmi: project/%.md
	hhtml -g < $< > $@
	sed -i 's/EXT/gmi/g' $@

blog/%.gmi: blog/%.md
	hhtml -g < $< > $@
	sed -i 's/EXT/gmi/g' $@

.PHONY: clean
clean:
	rm -rf */*.gmi \
	rm -rf */*.html index.html