my eye

Add identifiers to home page h-card

Committed 54dbdf

--- a/canopy/static/screen.css
+++ b/canopy/static/screen.css

 /* .h-card > div {
     display: inline-block; } */
 .namedesc {
-    display: inline-block; }
+    display: inline-block;
+    font-size: .75em;
+    line-height: 1.15; }
 .namedesc > p {
     margin: 0; }
 a.p-name {
+    color: #586e75;
     font-size: 2em;
-    font-weight: 500;
-    line-height: 1;
+    font-weight: 600;
     text-decoration: none; }
 p.p-note {
-    font-size:.75em;
     margin-top: .25em; }
 #search {
     margin: 0 0 .5em 0; }

--- a/canopy/templates/__init__.py
+++ b/canopy/templates/__init__.py

 import pprint
 
 import pendulum
+
 # TODO from micropub.readability import Readability
 import web
-import webint_live
-import webint_posts
 from mf import discover_post_type
 from webagt import Document
+from webint_live import app as live_app
+from webint_posts import app as posts_app
+from webint_system import get_key, get_onion
 
 __all__ = [
     "discover_post_type",
     "get_categories",
     "Document",
     "livestream",
+    "get_key",
+    "get_onion",
 ]
 
 tx = web.tx
-livestream = webint_live.app.view.stream
+livestream = live_app.view.stream
 
 
 def pformat(obj):
 
 def get_months():
     months = collections.defaultdict(collections.Counter)
-    for post in webint_posts.app.model.get_posts():
+    for post in posts_app.model.get_posts():
         published = post["published"][0]
         months[published.year][published.month] += 1
     return months
 
 
 def get_posts():
-    return webint_posts.app.model.get_posts()
+    return posts_app.model.get_posts()
 
 
 def get_categories():
-    return webint_posts.app.model.get_categories()
+    return posts_app.model.get_categories()

--- a/canopy/templates/template.html
+++ b/canopy/templates/template.html

 
 <header>
 <div class=h-card>
-    $if "photo" in owner:
-        <img class=u-photo src=/media/$owner["photo"][0]>
-    <div class=namedesc>
-    <a href=/ rel=me class="p-name u-url u-uid">
-        <strong>$owner["name"][0]</strong></a>
-    $if "note" in owner:
-        <p class=p-note>$owner["note"][0]</p>
-    </div>
-    $if "email" in owner:
-        $ email = get_first(owner, "email")
-        <p><small>
-            <a rel=me class=u-email href=mailto:$email>$email</a>
-            </small></p>
-    $if "onion" in owner:
-        <p><small>
-            $ onion = get_first(owner, "onion")
-            $if onion:
-                <a rel=me href=http://$onion><code>$onion</code></a>
-            </small></p>
-    $if "key" in owner:
-        <p><small>
-            $ key = get_first(owner, "key")
-            $if key:
-                <a href=/owner/key
-                    rel=me><code>$:"&ndash;".join(key.split()[:2])</code></a>
-            </small></p>
+$if "photo" in owner:
+    <img class=u-photo src=/media/$owner["photo"][0]>
+<div class=namedesc>
+<a class=p-name href=/><strong>$owner["name"][0]</strong></a><br>
+$if "note" in owner:
+    <span class=p-note>$owner["note"][0]</span><br>
+<small>
+$if onion := get_onion():
+    $ _stripped_onion = onion.lstrip("x")
+    $ _prefix_length = len(onion) - len(_stripped_onion)
+    <a class=u-url rel=me
+        href=http://$onion><code>$_stripped_onion[:12-_prefix_length]</code></a> &bull;
+<code><a class="u-url u-uid" rel=me href=/>$tx.host.name</code>
+$if email := get_first(owner, "email"):
+    &bull; <a class=u-email href=mailto:$owner["email"][0]><code>$owner["email"][0]</code></a>
+&bull; <a href=/owner/actor><code>@$owner["nickname"][0]@$tx.host.name</code></a>
+</small>
+$if key := get_key():
+    &bull; <a class=p-key href=/owner/keyring><code>$:"&ndash;".join(key.split()[:2])</code></a>
+</div>
 </div>
 <div>
 <form id=search action=/search>