3 ms·
Start simple! No problem with your approach. A lot of interesting blogs look like they are made this way. You could also use some shell magic to cat a header an
by quickthrower2 6y ago
Start simple! No problem with your approach. A lot of interesting blogs look like they are made this way. You could also use some shell magic to cat a header and footer to each page.
- shoo 6y ago> use some shell magic to cat a header and footer to each page. $ tree . . ├── footer.html ├── header.html ├── Makefile └── posts ├── a.body ├── b.body └── c.body $ cat Makefile BODYFILES=$(shell find posts -type f -name "*.body") POSTS=$(BODYFILES:.body=.html) dist/slug.tar.gz: index.html $(POSTS) mkdir -p dist && tar -czf $@ $^ index.body: $(POSTS) python3 -c "import sys; [print('<a href="%s">%s<a/>' % (x, x[:-5])) for x in sorted(sys.argv[1:])]" $^ > $@ %.html: header.html %.body footer.html cat $^ > $@ clean: rm -rf $(POSTS) index.body index.html dist .PHONY: clean
- boogies 6y ago> use some shell magic eg. 1600 SLOC: https://www.bkhome.org/shellcms/index.html https://www.bkhome.org/shellcms/index.html 1194: https://github.com/cfenollosa/bashblog https://github.com/cfenollosa/bashblog 82: https://github.com/LukeSmithxyz/lb https://github.com/LukeSmithxyz/lb 15: https://news.ycombinator.com/item?id=24552950 https://news.ycombinator.com/item?id=24552950