$def with (url, details, audits, a11y, manifest) $ short_title = str(url).removeprefix("@").removeprefix("https://") $# var title = short_title $ axes = ["identity", "authentication", "posts", "syndication", "posting UI", $ "navigation", "search", "aggregation", "interactivity", "security", $ "responses"] $ statuses = ["pass", "maybe", "fail"] $def render_uninterpreted(title, object, type):
Uninterpreted $title
$type:
$if details["domain"]["hsts"]:
https://
$elif url.scheme == "https":
https://
$else:
http://
$details["domain"]["name"]
$if "metaverse" in details:
$ hash = details["metaverse"][:5]
$hash
Accessed $details["accessed"]
$ response = details["response"] $response["length"] KB $if audits: / $get_human_size(audits["audits"]["total-byte-weight"]["numericValue"]) / $if response["time"] < 1: $round(response["time"] * 1000) ms $else: $round(response["time"], 2) s
$if ipa: $ipa[0] $if sound:
$if nicknames:a.k.a. $", ".join(nicknames)
$ pronouns = card.pop("pronouns", []) $ card.pop("pronoun", None) $if orgs and name == orgs[0]: đ§âđ¤âđ§ $elif pronouns: $if "they" in pronouns[0]: đ§ $elif "she" in pronouns[0]: đŠ $elif "he" in pronouns[0]: đ¨ $else: đ§ $if pronouns: $:pronouns[0].replace(" ", "").replace("/", " / ") $elif pronouns := card.pop("pronoun", None): $for pronoun in pronouns: $pronoun\ $if not loop.last: / \ $if bday := card.pop("bday", None): $ year, month, day = re.match("(\d\d\d\d|-)-(\d\d?|-)-(\d\d?|-)", bday[0]).groups() $if year != "-": $ year = int(year) $ month = int(month) $ day = int(day) $ months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] $ months += ["Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] $ n = now() đ $if "rel_me" in details: $ details["rel_me"] = details["rels"].pop("me", []) # TODO REMOVE $ urls = set(uri(u).minimized for u in card.pop("url", []) + details["rel_me"]) $ reciprocals = set(details.pop("reciprocals", [])) $ self_rel_me = f"indieweb.rocks/{url.minimized}" $if self_rel_me in reciprocals: $ urls.discard(self_rel_me) $ reciprocals.discard(self_rel_me) đ $if orgs:$role
\
$if not loop.last:
,
$if note := card.pop("note", None):
$note[0]
$if categories := card.pop("category", None):đˇī¸
$for category in categories:
\
$if isinstance(category, dict):
$ cat_props = category.pop("properties")
$if "url" in cat_props:
\
$cat_props["name"][0]\
$if "url" in cat_props:
\
$else:
$category\
\
$if not loop.last:
,
đ $if street_address: $street_address[0] $ area_line = [] $if locality: $ area_line.append(locality[0]) $if region: $ area_line.append(region[0]) $", ".join(area_line) $if postal_code: $postal_code[0] $if country_name: $country_name[0]
$ emails = [e.partition(":")[2] for e in card.pop("email", [])] $ tels = [] $for tel in card.pop("tel", []): $if ":" in tel: $tels.append(tel.partition(":")[2]) $else: $tels.append(tel) $ keys = set(card.pop("key", []) + rels.pop("pgpkey", [])) $ all_urls = list(urls) $for _url in sorted(urls): $if _url.startswith("sms:") or _url.startswith("callto:"): $ tel = _url.partition(":")[2] $if tel not in tels: $ tels.append(tel) $urls.remove(_url) $elif _url.startswith("mailto:"): $ email = _url.partition(":")[2] $if email not in emails: $ emails.append(email) $urls.remove(_url) $if emails:đ $for key in keys: $key $if not loop.last: , $ web_sign_in.append(uri(key).minimized)
$def render_rel_me(silo_name, domain, profile_pattern, user): $ path = re.sub(r"(\(.+\))", user, profile_pattern).replace("\\", "") $user $ supported_web_signin_silos = ["github.com", "twitter.com"] $if urls: $for _url in sorted(urls): $if _url.startswith(url.minimized): $ urls.remove(_url) $continue$meta_summary[0]
$if meta_content := meta_props.get("content"):No representative card found. $if meta_props: Falling back to metaformats.
$ license = rels.pop("license", None) $if license: $if "search_url" in details: $ search_url, search_query_name = details["search_url"] $ rels.pop("search") $if manifest: $ bgcolor = manifest.get("background_color", "none") $ auth_ep = rels.pop("authorization_endpoint", None) $ token_ep = rels.pop("token_endpoint", None) $ ticket_ep = None $ indieauth_metadata = details.pop("indieauth_metadata", None) $ openid_delegate = rels.pop("openid.delegate", None) $ openid_server = rels.pop("openid.server", None) $if indieauth_metadata: $ auth_ep = indieauth_metadata.get("authorization_endpoint", None) $ token_ep = indieauth_metadata.get("token_endpoint", None) $ ticket_ep = indieauth_metadata.get("ticket_endpoint", None) $if auth_ep:Supports $else:
Does not support IndieAuth\ $if auth_ep: $if token_ep: with a token endpoint\ $if ticket_ep: and a ticket endpoint\ .
$# $if auth_ep and not indieauth_metadata: $#rel=authorization_endpoint
is deprecated, leave
$# it for now but start using rel=indieauth-metadata
instead
$# read more
Supports web sign-in.
OpenID was a protocol for using a web address $# as an identity to sign-in to websites; it is losing support, is $# effectively dead (versions 1 & 2 are both deprecated, sites are $# dropping support), and has been replaced on the IndieWeb with $# web-sign-in and IndieAuth. read more
$ webmention_ep = rels.pop("webmention", None) $if webmention_ep:Supports $else:
Does not support Webmention on the homepage.
$ micropub_ep = rels.pop("micropub", None) $ media_ep = rels.pop("media-endpoint", None) $if micropub_ep:Supports $else:
Does not support Micropub\ $if micropub_ep and media_ep: with a media endpoint\ .
$ microsub_ep = rels.pop("microsub", None) $if microsub_ep:Supports $else:
Does not support Microsub.
No external stylesheets.
$# $# TODO inline stylesheets $# $#$script["text"]
No scripting.
$# $#...
This site has external dependencies.
This site is truly independent.
$len(a11y) accessibility concerns.
$else:There are no accessibility concerns.
$pformat(entry)$# $if details["whostyle"]: $#
next: $rel_next[0]
$if rel_prev := rels.pop("prev", None):previous: $rel_prev[0]
$else:No content feed available.
$if scores := details.get("scores"):