update now and links

This commit is contained in:
2025-07-15 22:22:49 +02:00
parent b9a403e9d9
commit 920ff8ae65
5 changed files with 50 additions and 49 deletions

View File

@@ -4,13 +4,13 @@ SRC_DIR = src
PAGES_DIR = $(SRC_DIR)/pages
BLOG_DIR = $(SRC_DIR)/blog
DIST_DIR = dist
BUILD_DIR = build
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 \
@@ -18,12 +18,13 @@ watch:
| entr -d make -f ./Makefile ; \
done
mkdist:
mkdirs:
mkdir -p $(DIST_DIR)
mkdir -p $(BUILD_DIR)
template: $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html | mkdist
template: $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html | mkdirs
cp -r $(SRC_DIR)/styles $(DIST_DIR)
cat $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html > dist/template.html
cat $(SRC_DIR)/start.html $(SRC_DIR)/nav.html $(SRC_DIR)/side.html > $(BUILD_DIR)/template.html
$(PAGES_DIR)/blog.html: $(BLOG_PAGES) $(BLOG_DIR)/start_blog.html $(BLOG_DIR)/end_blog.html
pandoc -f markdown -t html $^ -o $@.tmp
@@ -31,8 +32,9 @@ $(PAGES_DIR)/blog.html: $(BLOG_PAGES) $(BLOG_DIR)/start_blog.html $(BLOG_DIR)/en
rm $@.tmp
$(DIST_DIR)/%.html: $(PAGES_DIR)/%.html | template mkdist
cat $(DIST_DIR)/template.html $(PAGES_DIR)/$*.html $(SRC_DIR)/end.html > $@
cat $(BUILD_DIR)/template.html $(PAGES_DIR)/$*.html $(SRC_DIR)/end.html > $@
clean:
rm -rf dist
rm -rf $(DIST_DIR)
rm -rf $(BUILD_DIR)
rm -rf $(PAGES_DIR)/blog.html