init
This commit is contained in:
40
Makefile
Normal file
40
Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
# Makefile for reSW
|
||||
|
||||
CONTENTDIR = content
|
||||
STATICDIR = static
|
||||
BUILDDIR = build
|
||||
CONFIG = settings.toml
|
||||
SERVER ?=
|
||||
|
||||
all: build
|
||||
|
||||
help:
|
||||
@echo 'Build rSW site'
|
||||
@echo
|
||||
@echo 'Available targets:'
|
||||
@echo
|
||||
@echo ' build build HTML'
|
||||
@echo ' serve run local HTTP server'
|
||||
@echo ' css <theme> generate Pygments stylesheet'
|
||||
@echo
|
||||
@echo 'Run make without target to build html'
|
||||
|
||||
build:
|
||||
test -d "$(BUILDDIR)" && rm -rf "$(BUILDDIR)" || true
|
||||
rsw build -c "$(CONFIG)"
|
||||
|
||||
serve:
|
||||
python -m http.server --directory $(BUILDDIR)/ --bind 0.0.0.0 8080
|
||||
|
||||
css:
|
||||
mkdir -pv "$(STATICDIR)"/css/pygments
|
||||
pygmentize -f html -S $(filter-out $@,$(MAKECMDGOALS)) -a .highlight \
|
||||
> "$(STATICDIR)"/css/pygments/$(filter-out $@,$(MAKECMDGOALS)).css
|
||||
|
||||
publish:
|
||||
rsync --verbose -r $(BUILDDIR)/ $(SERVER):/srv/http/nixhacks.net/public/
|
||||
|
||||
%:
|
||||
@:
|
||||
|
||||
.PHONY: all help build serve css publish
|
Reference in New Issue
Block a user