$def with (permalink, entry, mentions) $var title = "?" $ p = entry["published"][0] $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 = ["h-entry"] # widescreen $# $if "mastodon" in entry.get("syndication", []): $ type = discover_post_type(entry) $def render_content(entry): $if "content" in entry: $ content = entry["content"][0]
$if isinstance(content, dict) and "html" in content:
$:post_mkdn(content["html"])
$else:
$:post_mkdn(content)
$if type == "note": $:render_content(entry) $elif type == "article": $var title = entry["name"][0] $:render_content(entry) $elif type == "weight":

$entry["summary"][0]

$ weight = entry["weight"][0]

$weight["num"] $weight["unit"]

$elif type == "audio/clip": $# $var title = entry["name"][0] $#

$entry["name"][0]

$ quotation_of = entry["quotation-of"][0]

Clipped from $quotation_of

$# XXX
$:post_mkdn(entry["content"][0])
$elif type == "bookmark": $ bookmark = entry["bookmark-of"][0] $var title: Bookmarked $bookmark

Bookmarked $bookmark

$elif type == "like": $ like = entry["like-of"][0] $var title: Liked $like

Liked $like

$elif type == "rsvp": $ in_reply_to = entry["in-reply-to"][0] $ rsvp = entry["rsvp"][0] $var title: RSVP $rsvp to $in_reply_to $var show_title = False $ colors = { $ "yes": "859900", $ "maybe": "b58900", $ "no": "cb4b16", $ }

RSVP $rsvp to $in_reply_to

$:render_content(entry) $else:

$type

$if tx.user.is_owner:
$for member_url in entry.get("audience", []):

$member_url

$#
$#
$# $# $if tx.user.is_owner: $# $# $for metric, value in Readability(entry["content"][0]).metrics.items(): $# $#

$metric

$# $#
$value
$# $# $# XXX $ a = entry["author"] $# $# XXX

$a["name"]

$def aside():
$if "published" in entry:

Published

$if "updated" in entry:

Updated

\ $entry["visibility"][0]

$ permalink = f"{tx.origin}{entry['url'][0]}"

\ $permalink ðŸ“‹

$# $if tx.user.session: $# reply $# $else: $# reply $var aside = aside() $# $# $elif type == "identification": $# $ identification = entry["identification-of"][0] $# $var title: Identified $identification["name"] $#

Identified $identification["name"]

$# $elif type == "follow": $# $ follow = entry["follow-of"][0] $# $var title: Followed $follow["name"] $#

Followed $follow["name"]

$# TODO $if tx.user.is_owner: $# TODO $# TODO