diff --git a/blog/feeds.md b/blog/feeds.md new file mode 100644 index 0000000..90ebeac --- /dev/null +++ b/blog/feeds.md @@ -0,0 +1,5 @@ +title: Get started using feeds +summary: Pick a client, add some feeds, done +published: 2020-06-02 + +--- diff --git a/blog/irc.md b/blog/irc.md new file mode 100644 index 0000000..330fbb6 --- /dev/null +++ b/blog/irc.md @@ -0,0 +1,5 @@ +title: Get started with IRC +summary: Pick a client, join some channels, maybe register with NickServ +published: 2020-06-02 + +--- diff --git a/do_index.py b/do_index.py new file mode 100755 index 0000000..d6d778e --- /dev/null +++ b/do_index.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import sys +from strictyaml import load as load_yaml +from ipo import list, str, read, write, map, starstarmap, takewhile, join, sort +from glob import glob +import re + +TEMPLATE = """ +
  • +
    {title}
    +
    {summary}
    +
  • """ + +def metadata(filename): + with open(filename) as fh: + metadata_yaml = read(fh) | takewhile(lambda line: line != "---") | join("\n") + return { + **load_yaml(metadata_yaml).data, + "path": re.sub(r".md$", "", filename) + } + +blog_post_list = glob("blog/*.md") | map(metadata) | sort(key=lambda x: x["published"]) | starstarmap(TEMPLATE.format) | join("") + +with open(sys.argv[1]) as file_in, open(sys.argv[2], "w") as file_out: + file_in.read().format(blog_posts=blog_post_list) | write(file=file_out) diff --git a/index.html b/index.html index b6fd69a..bf74775 100644 --- a/index.html +++ b/index.html @@ -16,15 +16,7 @@

    Blog

    -