$def with (resource) $ path = tx.request.uri.path $ owner = tx.host.owner $if not tx.request.uri.path: \ $if "title" in resource: $:Document(resource.title).doc.text_content() — \ $owner["name"][0] $if not isinstance(resource, str) and "head" in resource: $:resource.head() $if tx.user.is_owner:

$owner["name"][0]

$if "note" in owner:

$owner["note"][0]

$if "email" in owner: $ email = get_first(owner, "email")

$email

$if "onion" in owner:

$ onion = get_first(owner, "onion") $if onion: $onion

$if "key" in owner:

$ key = get_first(owner, "key") $if key: $:"–".join(key.split()[:2])

About – Now

$def render_breadcrumbs(breadcrumbs, separator="▸", padding=" "): $ """ $ Render a `separator` delimited list of linkified `breadcrumbs`. $ $ `breadcrumbs` should be a single tuple that will be read two items at a time: $ $ ("path", "Name", "subpath", "Subname", ...) $ $ """ $ remaining = int(len(breadcrumbs) / 2) $ path = "" $for crumb_path, crumb_title in zip(*(breadcrumbs[i::2] for i in (0, 1))): $ crumb_path = str(crumb_path) $ crumb_icon, crumb_classes = None, None $if isinstance(crumb_title, tuple): $ crumb_icon, crumb_classes, crumb_title = crumb_title $ path = path + "/" + crumb_path $ ups = " ".join(["up"] * remaining) $ remaining = remaining - 1 \ $if crumb_icon:  \ $:crumb_title\ $:padding$:separator\
$if path: $ breadcrumbs = [] $ parts = path.split("/") $ app = parts[0] $if len(parts) > 1: $ breadcrumbs += [app, app.capitalize()] $if "breadcrumbs" in resource: $ breadcrumbs += list(resource["breadcrumbs"]) $if breadcrumbs: $if "title" in resource: $if getattr(resource, "show_title", True):

$:resource.title

$:resource
$if "hide_footer" not in resource: