Compare commits
No commits in common. "89410758ebe8e22cca086670d5c57ae30923e664" and "1a7c02ca64a6cd74d02030a037a25c6ec932dea5" have entirely different histories.
89410758eb
...
1a7c02ca64
11
Makefile
11
Makefile
|
@ -3,13 +3,11 @@
|
|||
help: ## display this help
|
||||
@awk 'BEGIN{FS = ":.*##"; printf "\033[1m\nUsage\n \033[1;92m make\033[0;36m <target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
|
||||
|
||||
build: ## compile src/ into out/
|
||||
build: ## compile src/ into out/ with pagefind
|
||||
./build.py out/
|
||||
|
||||
index: ## generate search index with pagefind
|
||||
pagefind --site out/
|
||||
|
||||
clean: ## delete out/ and srv/
|
||||
clean: ## delete out/ and src/
|
||||
test -e out && rm -rf out || true
|
||||
test -e srv && rm -rf srv || true
|
||||
|
||||
|
@ -19,10 +17,11 @@ watch: ## rebuild on changes
|
|||
serve: ## serve out/
|
||||
python -m http.server --directory out/
|
||||
|
||||
pubdate: ## Replace "pubdate: now" with the current date
|
||||
sed -i "s/pubdate: now/pubdate: $$(date -Isec)/" src/blog/**/*.md
|
||||
|
||||
upload: ## build to srv/ and upload to www.alogoulogoi.com
|
||||
git stash -u
|
||||
test -e srv && rm -rf srv || true
|
||||
./build.py srv/
|
||||
pagefind --site srv/
|
||||
rsync -av --delete srv/ ssh.alogoulogoi.com:/srv/www.alogoulogoi.com
|
||||
git stash pop
|
||||
|
|
30
build.py
30
build.py
|
@ -103,6 +103,36 @@ def main():
|
|||
page.title.string = meta_title[0]
|
||||
page.header.h1.string = meta_title[0]
|
||||
|
||||
if meta_date := meta.get("date"):
|
||||
p = page.new_tag("p")
|
||||
p["class"] = "metadata"
|
||||
p.string = "Date: " + meta_date[0]
|
||||
page.header.append(p)
|
||||
|
||||
if meta_author := meta.get("author"):
|
||||
p = page.new_tag("p")
|
||||
p["class"] = "metadata"
|
||||
p.string = "Author: " + meta_author[0]
|
||||
page.header.append(p)
|
||||
|
||||
if meta_source := meta.get("source"):
|
||||
for source_url in meta_source:
|
||||
a = page.new_tag("a")
|
||||
a["href"] = source_url
|
||||
a.string = source_url
|
||||
p = page.new_tag("p")
|
||||
p["class"] = "metadata"
|
||||
p.string = "URL: "
|
||||
p.append(a)
|
||||
page.header.append(p)
|
||||
|
||||
if meta_comment := meta.get("comment"):
|
||||
for comment in meta_comment:
|
||||
aside = page.new_tag("aside")
|
||||
html = bs4.BeautifulSoup(comment_md.convert(comment), features="html.parser")
|
||||
aside.extend(html.p.contents)
|
||||
page.header.append(aside)
|
||||
|
||||
# RSS metadata
|
||||
if "feed" in meta:
|
||||
pubdate = get_pubdate(path.as_posix())
|
||||
|
|
Loading…
Reference in New Issue