blob: d6069a7e869650bd61b2bcade2a3ec0f5b85d4d5 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# BENZIN Makefile
PANDOC_ARGS=--from=gfm+emoji --to=html --section-divs
HEADER=templates/header.html
OPENRING_TEMPLATE=templates/openring.html
RSS=out/blog/index.xml
OPENRING_FOOTER=tmp/openring.html
OPENRING_ARGS=-s https://eug-vs.xyz/blog/index.xml
BLOG_SOURCES=$(wildcard src/blog/*.md)
SOURCES=$(wildcard src/*.md) $(BLOG_SOURCES)
TMP_HTML=$(patsubst src/%.md, tmp/%.content.html, $(SOURCES))
HTML=$(patsubst src/%.md, out/%.html, $(SOURCES))
BLOG_XML=$(patsubst src/%.md, tmp/%.xml, $(BLOG_SOURCES))
.PHONY: clean all
.SECONDARY: $(TMP_HTML)
all: $(HTML) $(RSS)
out/%.html: $(HEADER) tmp/%.content.html $(OPENRING_FOOTER)
@mkdir -p $(@D)
cat $^ > $@
tmp/%.content.html: src/%.md
@mkdir -p $(@D)
pandoc $(PANDOC_ARGS) $< > $@
$(RSS): $(BLOG_XML)
@echo $@
@echo '<rss version="2.0"><channel>' > $@
@echo "<title>TODO</title><link>TODO</link><description>TODO</description>" >> $@
@echo "<lastBuildDate>$$(date --rfc-email)</lastBuildDate>" >> $@
cat $^ >> $@
@echo '</channel></rss>' >> $@
tmp/%.xml: tmp/%.content.html
@echo '<item>' > $@
@echo " <link>TODO</link>" >> $@
@echo " <pubDate>TODO</pubDate>" >> $@
@echo " <title>TODO</title>" >> $@
@echo " <description><![CDATA[" >> $@
cat $< >> $@
@echo " ]]></description>" >> $@
@echo '</item>' >> $@
$(OPENRING_FOOTER): $(OPENRING_TEMPLATE)
@mkdir -p $(@D)
openring $(OPENRING_ARGS) < $< > $@
clean:
rm -rf tmp out
|