bskyweb: re-work HTML meta tags, for share cards (#596)

This commit is contained in:
bnewbold 2023-05-08 13:03:03 -07:00 committed by GitHub
parent 6d9e23b1be
commit 249d166811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 50 deletions

View file

@ -1,25 +1,32 @@
{% extends "base.html" %}
{% block head_page_meta -%}
<!-- TODO: "same as" indication with DID? -->
{# TODO: "same as" indication with DID? #}
{# TODO: could work in profileView.DisplayName here, conditionally? #}
{% block html_head_extra -%}
{%- if profileView -%}
<meta property="og:type" content="article"/>
<meta name="twitter:card" content="summary"/>
{%- if profileView.DisplayName -%}
<meta property="og:title" content="{{ profileView.DisplayName }} / {{ profileView.Handle }}"/>
<meta name="twitter:title" content="{{ profileView.DisplayName }} / {{ profileView.Handle }}"/>
{%- else -%}
<meta property="og:title" content="{{ profileView.Handle }}"/>
<meta name="twitter:title" content="{{ profileView.Handle }}"/>
{%- endif -%}
<meta name="twitter:description" content="{{ profileView.Description }}"/>
{%- if profileView.Avatar -%}
<meta property="og:type" content="article"/>
<meta name="twitter:card" content="summary"/>
<meta property="og:title" content="{{ profileView.Handle }} - Bluesky"/>
<meta name="twitter:title" content="{{ profileView.Handle}} - Bluesky"/>
{%- if profileView.Description %}
<meta property="og:description" content="{{ profileView.Description }}"/>
<meta name="twitter:description" content="{{ profileView.Description }}"/>
{% endif -%}
{%- if profileView.Avatar %}
<meta property="og:image" content="{{ profileView.Avatar }}"/>
<meta name="twitter:image" content="{{ profileView.Avatar }}"/>
{%- endif -%}
{% endif -%}
<meta name="twitter:label1" content="Author DID">
<meta name="twitter:value1" content="{{ profileView.Did }}">
{%- endif -%}
{%- endblock %}
{% block noscript_extra -%}
<p>{{ profileView.DisplayName }} / {{ profileView.Handle }}
<p>{{ profileView.Description }}
<div id="bsky_profile_summary">
<h3>Profile</h3>
<p id="bsky_display_name">{{ profileView.DisplayName }}</p>
<p id="bsky_handle">{{ profileView.Handle }}</p>
<p id="bsky_did">{{ profileView.Did }}</p>
<p id="bsky_profile_description">{{ profileView.Description }}</p>
</div>
{%- endblock %}