Glob in makefile, not in page.py

This commit is contained in:
Midgard 2020-06-13 15:50:39 +02:00
parent ad32f28568
commit 5b014b97da
Signed by untrusted user who does not match committer: midgard
GPG Key ID: 511C112F1331BBB4
2 changed files with 3 additions and 5 deletions

View File

@ -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)"

View File

@ -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],
}) |