$def with (entries) $var title: Recent
$for entry in entries: $ e = entry["resource"] $ type = discover_post_type(e)
$if type == "note":

$e["content"][0]

$ likes = [] $for m in get_mentions(e["url"][0]): $ d = m["data"] $if d and d["comment_type"]: $likes.append(d["author"]) $if likes: $len(likes) $emoji.emojize(":red_heart:") $elif type == "bookmark": $ bookmark = e["bookmark-of"][0]

Bookmarked $bookmark

$elif type == "like": $ like = e["like-of"][0] $ context = tx.cache[like].entry $ pt = discover_post_type(context.data)

Liked $context["author"]["name"]'s $pt

$:context["content"]
$elif type == "rsvp": $ event = e["in-reply-to"][0]

RSVP'd $e["rsvp"][0] $event["name"][0]

$ published = e["published"]

$# $elif type == "identification": $# $ identification = e["identification-of"][0] $#

Identified $identification["name"]

$# $elif type == "follow": $# $ follow = e["follow-of"][0] $#

Followed $follow["name"]

$def head(): $var head = head