Add: Beliefs

WIP: Blog
This commit is contained in:
2025-02-13 21:09:48 +01:00
parent 49f1f015df
commit 0928cc0b45
10 changed files with 125 additions and 27 deletions

View File

@@ -1,29 +1,35 @@
.PHONY: mkdist clean
.PHONY: all mkdist watch clean
all: clean index now links
rm -rf dist/template.html
SRC_DIR = src
PAGES_DIR = $(SRC_DIR)/pages
BLOG_DIR = $(SRC_DIR)/blog
DIST_DIR = dist
PAGES = $(notdir $(wildcard $(PAGES_DIR)/*.html))
BLOG_PAGES = $(wildcard $(BLOG_DIR)/*.md)
TARGETS = $(addprefix $(DIST_DIR)/,$(PAGES))
all: $(PAGES_DIR)/blog.html $(TARGETS)
rm -rf $(DIST_DIR)/template.html
watch:
while sleep 1 ; do \
find ./src -iname '*.html' -o -name "*.css" \
find ./$(SRC_DIR) -iname '*.html' -o -name "*.css" \
| entr -d make -f ./Makefile ; \
done
mkdist:
mkdir -p dist
mkdir -p $(DIST_DIR)
template: mkdist src/start.html src/nav.html src/side.html
cp -r src/styles dist
cat src/start.html src/nav.html src/side.html > dist/template.html
template: $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html | mkdist
cp -r $(SRC_DIR)/styles $(DIST_DIR)
cat $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html > dist/template.html
index: template src/pages/index.html
cat dist/template.html src/pages/index.html src/end.html > dist/index.html
$(PAGES_DIR)/blog.html: $(BLOG_PAGES)
pandoc -f markdown -t html $^ -o $@
now: template src/pages/now.html
cat dist/template.html src/pages/now.html src/end.html > dist/now.html
links: template src/pages/links.html
cat dist/template.html src/pages/links.html src/end.html > dist/links.html
$(DIST_DIR)/%.html: $(PAGES_DIR)/%.html | template mkdist
cat $(DIST_DIR)/template.html $(PAGES_DIR)/$*.html $(SRC_DIR)/end.html > $@
clean:
rm -rf dist