From 5b014b97dac923b5998e35bca6c7dd351023fea5 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Sat, 13 Jun 2020 15:50:39 +0200 Subject: [PATCH] Glob in makefile, not in page.py --- makefile | 2 +- page.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index f384573..d41e247 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ all: $(BUILD_DIR)/index.html $(BUILD_DIR)/syntax.css public $(BLOG_HTML) $(BUILD_DIR)/index.html: templates/index.html $(BLOG) page.py @mkdir -p "$(@D)" - $(PYTHON) page.py --index "$<" "$@" + $(PYTHON) page.py --index "$<" "$@" $(BLOG) $(BUILD_DIR)/blog/%.html: blog/%.md templates/blog.html page.py @mkdir -p "$(@D)" diff --git a/page.py b/page.py index 799e911..4209f45 100755 --- a/page.py +++ b/page.py @@ -2,11 +2,9 @@ import sys import re -from glob import glob -from ipo import read, write, map, dictmap, starstarmap, join, sort, ipo -from functools import partial from markdown import markdown import strictyaml +from ipo import read, write, map, dictmap, starstarmap, join, sort, ipo md_to_html = join("\n") | ipo(markdown) @@ -104,7 +102,7 @@ def safe_metadata(metadata): if sys.argv[1] == "--index": blog_post_list = ( - glob("blog/*.md") | + sys.argv[4:] | map(lambda filename: { **blog_page(filename, read_body=False)[0], }) |