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