Site generator for https://rct.in-berlin.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.2 KiB

PROOT=$(CURDIR)
INDIR=$(PROOT)/content
OUTDIR=$(PROOT)/output
PANDOC=/usr/bin/pandoc
PANDOC_OPTS=-f markdown-citations-smart+raw_html --filter md2html.sh --template=html5.tpl -t html5
PANDOC_TERM_OPTS=-f markdown-smart -t html5 --filter md2html.sh --filter paragraphs-in-term-width.sh --template=html5.tpl
SOURCE_FILES = $(shell find $(INDIR) -type f -name '*.md' -not -path 'content/.git/*')
TARGET_FILES = $(patsubst %.md,%.html,$(subst $(INDIR),$(OUTDIR),$(SOURCE_FILES)))
SOURCE_DIRS = $(shell find $(INDIR) -type d -not -path 'content/.git/*')
TARGET_DIRS = $(subst $(INDIR),$(OUTDIR),$(SOURCE_DIRS))
help:
@echo ' '
@echo ' make html (re)generate html '
@echo ' make dh open python httpd in $(OUTDIR) '
@echo ' '
all: html
html: $(TARGET_FILES)
$(OUTDIR)/%.html: $(INDIR)/%.md html5.tpl md2html.sh paragraphs-in-term-width.sh
@mkdir -p $(@D)
$(PANDOC) $(PANDOC_OPTS) $< -o $@
dh:
@python -m http.server --bind 127.0.0.1 --directory $(OUTDIR)
.PHONY: help html all dh