Fix breadcrumbs
Committed c48265
--- a/webint_posts/templates/__init__.py
+++ b/webint_posts/templates/__init__.py
import operator
+import re
+import pendulum
import web
from mf import discover_post_type
from web import tx
-__all__ = ["tx", "operator", "discover_post_type", "post_mkdn"]
+__all__ = ["tx", "operator", "discover_post_type", "post_mkdn", "re", "pendulum"]
def post_mkdn(content):
--- a/webint_posts/templates/day.html
+++ b/webint_posts/templates/day.html
$def with (year, month, day, posts)
+$ p = pendulum.date(year, month, day)
+$var breadcrumbs = (p.format("MM"), p.format("MMMM"))
$var title: $month $day $year
<ul>
--- a/webint_posts/templates/entry.html
+++ b/webint_posts/templates/entry.html
$def with (permalink, entry, mentions)
$var title = "?"
$ p = entry["published"][0]
-$if tx.request.uri.path.startswith("2023"):
+$if re.match("(19|20)\d\d", tx.request.uri.path):
$var breadcrumbs = (p.format("MM"), p.format("MMMM"), p.format("DD"), p.format("D"))
$# var body_classes = ["widescreen"]
$var classes = ["h-entry"]