~kvik/ugh

ref: ee19f22be32c725ab41c27918de1e6240d1866fc ugh/mkfile -rw-r--r-- 806 bytes
ee19f22bkvik mksitemap: add sitemap generator 1 year, 1 month 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
sources = `{walk -f data/ | grep -v '^data/\.git/'}
pages = ${sources:data/%=public/%}
md =    `{{for(i in $pages) echo $i}| grep '\.md$'}
txt =   `{{for(i in $pages) echo $i}| grep '\.txt$'}
shtml = `{{for(i in $pages) echo $i}| grep '\.shtml$'}
pages = ${md:   public/%.md=   public/%.html} \
        ${shtml:public/%.shtml=public/%.html} \
        $md $txt \
        public/sitemap.html

all:V: pages

pages:V: $pages

clean:V:
	rm -rf $pages

public/sitemap.md: $sources
	bin/mksitemap data/ >$target

public/sitemap.html: public/sitemap.md
	bin/md2html public/sitemap.md $target

public/%.html: data/%.md
	bin/md2html data/$stem.md $target

public/%.html: data/%.shtml
	cp data/$stem.shtml $target

public/%.md: data/%.md
	cp data/$stem.md $target

public/%.txt: data/%.txt
	cp data/$stem.txt $target