diff options
author | bnewbold <bnewbold@robocracy.org> | 2023-05-11 08:41:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 10:41:47 -0500 |
commit | d624b7cf58d1a594dc8e375ebe106d344ed03ccc (patch) | |
tree | dc158fce890f2379c71dc54cb152481d0efa0ed1 /bskyweb/templates/post.html | |
parent | 19d6ded631b3a22bc44e7763bf1f75efa704be4d (diff) | |
download | voidsky-d624b7cf58d1a594dc8e375ebe106d344ed03ccc.tar.zst |
bskyweb: iterate on HTML card metadata (#609)
Probably still not perfect, but better. - don't user avatar image. use banner for profile and post img, or nothing - most twitter metadata fields were redundant; twitter will parse out opengraph ("og:"), so don't duplicate those - add regular HTML description (for google, etc) - include URI - actually include text
Diffstat (limited to 'bskyweb/templates/post.html')
-rw-r--r-- | bskyweb/templates/post.html | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/bskyweb/templates/post.html b/bskyweb/templates/post.html index 866a97396..05d62a1c8 100644 --- a/bskyweb/templates/post.html +++ b/bskyweb/templates/post.html @@ -1,23 +1,39 @@ {% extends "base.html" %} -{# TODO: link rel=canonical #} -{# TODO: "same as" #} +{% block head_title %} +{%- if postView -%} + @{{ postView.Author.Handle }} on Bluesky +{%- else -%} + Bluesky +{%- endif -%} +{% endblock %} + {% block html_head_extra -%} -{%- if postView %} - <meta property="og:type" content="article"/> - <meta name="twitter:card" content="summary"/> - <meta property="og:title" content="{{ postView.Author.Handle }} - Bluesky"/> - <meta name="twitter:title" content="{{ postView.Author.Handle }} - Bluesky"/> - {%- if postView.Author.Avatar %} - <meta property="og:image" content="{{ postView.Author.Avatar }}"/> - <meta name="twitter:image" content="{{ postView.Author.Avatar }}"/> +{%- if postView -%} + <meta property="og:type" content="website"> + <meta property="og:site_name" content="Bluesky Social"> + {%- if requestURI %} + <meta property="og:url" content="{{ requestURI }}"> + {% endif -%} + {%- if postView.Author.DisplayName %} + <meta property="og:title" content="{{ postView.Author.DisplayName }} (@{{ postView.Author.Handle }})"> + {% else %} + <meta property="og:title" content="@{{ postView.Author.Handle }}"> {% endif -%} - {%- if postView.Record.Text %} - <meta property="og:description" content="{{ postView.Record.Text }}"/> - <meta name="twitter:description" content="{{ postView.Record.Text }}"/> + {%- if postView.Record.Val.Text %} + <meta name="description" content="{{ postView.Record.Val.Text }}"> + <meta property="og:description" content="{{ postView.Record.Val.Text }}"> {% endif -%} - <meta name="twitter:label1" content="Author DID"> - <meta name="twitter:value1" content="{{ postView.Author.Did }}"> + {%- if imgThumbUrl %} + <meta property="og:image" content="{{ imgThumbUrl }}"> + <meta name="twitter:card" content="summary_large_image"> + {%- elif postView.Author.Avatar %} + {# Don't use avatar image in cards; usually looks bad #} + <meta name="twitter:card" content="summary"> + {% endif %} + <meta name="twitter:label1" content="Posted At"> + <meta name="twitter:value1" content="{{ postView.CreatedAt }}"> + <meta name="twitter:site" content="@bluesky"> {% endif -%} {%- endblock %} |