News for hackers. Stuff that matters.
Re:Ask HN: Are there any downsides to building a blog using ... by quickthrower2 on Tuesday September 22, 2020 @06:11AM (#24552789)
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.
Re:Ask HN: Are there any downsides to building a blog using ... by shoo on Tuesday September 22, 2020 @06:40AM (#24552950)
> 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
Re:Ask HN: Are there any downsides to building a blog using ... by boogies on Tuesday September 22, 2020 @03:02PM (#24558480)