The making of a publication for the 2020 edition of the AMRO festival organised by Servus. (Alice & Manetta are working on this.)
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.

74 lines
1.9 KiB

4 years ago
PY?=python3
PELICAN?=pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
RELATIVE ?= 0
ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls
endif
SERVER ?= "0.0.0.0"
PORT ?= 0
ifneq ($(PORT), 0)
PELICANOPTS += -p $(PORT)
endif
help:
@echo 'Makefile for a pelican Web site '
@echo ' '
@echo 'Usage: '
@echo ' make html (re)generate the web site '
@echo ' make devserver [PORT=8000] serve and regenerate together '
@echo ' make print generate the HTML and PDF files '
4 years ago
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
@echo ' '
# Make on the server
4 years ago
html:
@echo '----------------'
4 years ago
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
@echo '----------------'
python3 rss-to-ap/rss-to-ap.py
@echo '----------------'
4 years ago
# Work-in-process mode
devserver:
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
4 years ago
# Print
md=$(wildcard print/*.md)
md2html=$(md:%.md=%.html)
md2pdf=$(md:%.md=%.pdf)
4 years ago
%.html: %.md
pandoc --from markdown --to html -c themes/basic/static/css/print.css $< -o $@
4 years ago
%.pdf: %.md themes/basic/static/css/print.css
pandoc --pdf-engine=weasyprint -c themes/basic/static/css/print.css $< -o $@
print: $(md2html) $(md2pdf)
4 years ago