$def with (resource) $ path = tx.request.uri.path $ owner = tx.host.owner $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 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() $# $# $# $# $# $#

$# $ rel_mes = [ $# $ ] $# $# "github.com/angelogladding", $# $# "twitter.com/angelogladding", $# $# "pypi.org/user/angelogladding", $# $# "indieweb.org/User:Ragt.ag", $# $# "npmjs.com/~angelogladding", $# $# "news.ycombinator.com/user?id=angelo", $# $# "soundcloud.com/angelogladding", $# $# "twitch.tv/ragt_ag", $# $# "youtube.com/channel/UCxAy9XppNzdXWu599DuUaMw", $# $# "stackoverflow.com/users/6841359/angelo-gladding", $# $# "openstreetmap.org/user/ragt_ag", $# $# "nextdoor.com/profile/01KNsh_PChYkNQ3Mr", $# $# "patreon.com/ragt_ag", $# $# "kickstarter.com/profile/ragt-ag", $# $# "goodreads.com/user/show/60863069-angelo-gladding" $# $for rel_me in rel_mes: $# $ domain = rel_me.partition(".")[0] $# $rel_me.partition('.')[0]\ $#

$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 "aside" in resource:
$# $if "prefix" in resource: $# $:resource.prefix $#
$# XXX $if path and "breadcrumbs" in resource: $# XXX $:render_breadcrumbs(resource["breadcrumbs"]) $#
$# $if "title" in resource and getattr(resource, "show_title", True): $#

$:resource.title

$# $if "header" in resource: $# $:resource.header() $#
$#
$# $:resource $#
$#
$# $if "suffix" in resource: $# $:resource.suffix $# $# $if "hide_footer" not in resource: