Glob in makefile, not in page.py
This commit is contained in:
parent
ad32f28568
commit
5b014b97da
2 changed files with 3 additions and 5 deletions
2
makefile
2
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)"
|
||||
|
|
6
page.py
6
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],
|
||||
}) |
|
||||
|
|
Loading…
Reference in a new issue