How the Site is Generated

The site is written in markdown, and then generated to HTMLs with pandoc and make.

  1. Write your content in a markdown file and filename must end with “.md”
  2. run make

Optionally, you can install lips, which allows you to embed shell commands in lines beginning with #+sh in your markdown. These lines will be replaced by the output the shell commands. This is how index.md generated the post list in index.html.

Here is the Makefile:

PANDOC = pandoc --include-before-body=before_body.html.txt --include-after-body=after_body.html.txt
# In case you need content generating, use the script from https://github.com/ptpt/lips,
# otherwise just:
# CAT = cat
CAT = ./_lips/lips/src.awk

# find out all targets
HTMLS = $(patsubst %.md, %.html, $(wildcard *.md))

all: $(HTMLS)

index.html: $(filter-out index.html, $(wildcard *.html)) index.md index.py
    $(CAT) index.md | $(PANDOC) -o $@

how_this_site_is_generated.html: how_this_site_is_generated.md Makefile
    $(CAT) $< | $(PANDOC) -o $@

%.html: %.md
    $(CAT) $< | $(PANDOC) -o $@

.PHONY: all

Back to Home