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

2 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 '
2 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
2 years ago
html:
@echo '----------------'
2 years ago
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
@echo '----------------'
python3 rss-to-ap/rss-to-ap.py
@echo '----------------'
2 years ago
# Work-in-process mode
devserver:
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
2 years ago
# Print
md=$(wildcard print/*.md)
md2html=$(md:%.md=%.html)
md2pdf=$(md:%.md=%.pdf)
2 years ago
%.html: %.md
pandoc --from markdown --to html -c ../themes/basic/static/css/print.css -s $< -o $@
2 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)
2 years ago