summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-09-30 19:01:31 +0100
committerTomasz Kramkowski <tk@the-tk.com>2021-09-30 19:01:31 +0100
commitf152a3cefec37a7f7fbd867eed6cd4337dee99cf (patch)
treeac37190336a2fc3734a5cda57b684b018e40f3eb
parent723d69446f378d30bed38327da0883f562668736 (diff)
downloadthe-tk.com-f152a3cefec37a7f7fbd867eed6cd4337dee99cf.tar.gz
the-tk.com-f152a3cefec37a7f7fbd867eed6cd4337dee99cf.tar.xz
the-tk.com-f152a3cefec37a7f7fbd867eed6cd4337dee99cf.zip
Run post preambles through md in index
-rwxr-xr-xgenerate.py1
-rw-r--r--templates/index.html2
2 files changed, 2 insertions, 1 deletions
diff --git a/generate.py b/generate.py
index 6328a9d..956e842 100755
--- a/generate.py
+++ b/generate.py
@@ -118,6 +118,7 @@ def main(argv=['generate.py']):
env = Environment(loader=FileSystemLoader('./templates'), autoescape=True)
env.globals['site'] = {'baseurl': baseurl}
env.filters['datefmt'] = lambda d, f='%Y-%m-%d': d.strftime(f)
+ env.filters['md'] = md
posts = glob(os.path.join(CONTENT, 'posts', '*'))
posts = [p for p in posts if not os.path.split(p)[1].startswith('_')]
diff --git a/templates/index.html b/templates/index.html
index c32a7fb..6a64d79 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -11,7 +11,7 @@
<header>
<h3>{{ post.title }}</h3>
</header>
- {{ post.pre }}
+ {{ post.pre|md }}
<a href="/{{ post.location }}">Read more...</a>
<footer>
<time>{{ post.date|datefmt }}</time>