From 02a3376c5cd89c6e66fb6354e75cb089a9300f8c Mon Sep 17 00:00:00 2001 From: /dev/urandom Date: Fri, 5 Jun 2020 11:49:29 +0300 Subject: [PATCH] compatibility with alpine --- Makefile | 10 +++++++--- blogindex.sh | 2 +- upload.sh | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bae73ff..72fe29b 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ --include Makefile.pwd +-include Makefile.cfg OUTDIR=out PAGEDIR=pages SRCDIR=src TPLDIR=tpl +ifndef THEME +THEME=theme +endif + _PNGS = $(shell find $(PAGEDIR) -name \*.png) PNGS = $(patsubst $(PAGEDIR)/%,$(OUTDIR)/%,$(_PNGS)) @@ -30,11 +34,11 @@ upload: $(OUTDIR)/blog/index.html: $(_BLOG_PAGES) $(TPLDIR)/blog_header.md $(TPLDIR)/blog_footer.md $(TPLDIR)/default.tpl @mkdir -p $(@D) - ./blogindex.sh | theme -C style -t $(TPLDIR)/default.tpl -p blog/index.html -o $@ + ./blogindex.sh | $(THEME) -C style -t $(TPLDIR)/default.tpl -p blog/index.html -o $@ $(OUTDIR)/%.html: $(PAGEDIR)/%.md $(TPLDIR)/default.tpl @mkdir -p $(@D) - theme -C style -t $(TPLDIR)/default.tpl -p $(patsubst $(OUTDIR)/%,%,$@) -o $@ $< + $(THEME) -C style -t $(TPLDIR)/default.tpl -p $(patsubst $(OUTDIR)/%,%,$@) -o $@ $< $(OUTDIR)/%: static/%.h @mkdir -p $(@D) diff --git a/blogindex.sh b/blogindex.sh index a03a1a8..a187c56 100755 --- a/blogindex.sh +++ b/blogindex.sh @@ -7,7 +7,7 @@ if [[ -z $LASTUPLOAD ]]; then LASTUPLOAD=0; fi #echo "Last upload at $LASTUPLOAD" -FILES=`ls $DIRECTORY/*.md -1ct --time=birth` +FILES=`ls $DIRECTORY/*.md -1ct` cat tpl/blog_header.md diff --git a/upload.sh b/upload.sh index 6c7c571..539b10f 100755 --- a/upload.sh +++ b/upload.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if ! [[ -f upload.pwd ]]; then echo "You need a file named upload.pwd with the following format:"