Compare commits

...

2 Commits

Author SHA1 Message Date
Hailey 801828a57d revert a couple things 2025-09-18 10:55:01 -07:00
Hailey 006d813291 improve profile card 2025-09-18 10:54:00 -07:00
3 changed files with 36 additions and 19 deletions
+7 -3
View File
@@ -394,6 +394,7 @@ func (srv *Server) Shutdown() error {
func (srv *Server) NewTemplateContext() pongo2.Context {
return pongo2.Context{
"staticCDNHost": srv.cfg.staticCDNHost,
"favicon": fmt.Sprintf("%s/static/favicon.png", srv.cfg.staticCDNHost),
}
}
@@ -599,13 +600,16 @@ func (srv *Server) WebProfile(c echo.Context) error {
unauthedViewingOkay = false
}
}
if !unauthedViewingOkay {
return c.Render(http.StatusOK, "profile.html", data)
}
req := c.Request()
data["profileView"] = pv
data["requestURI"] = fmt.Sprintf("https://%s%s", req.Host, req.URL.Path)
data["requestHost"] = req.Host
if !unauthedViewingOkay {
data["requiresAuth"] = true
}
return c.Render(http.StatusOK, "profile.html", data)
}
+1
View File
@@ -95,6 +95,7 @@
<meta name="application-name" content="Bluesky">
<meta name="generator" content="bskyweb">
<meta property="og:site_name" content="Bluesky Social">
<meta property="og:logo" content="{{ favicon }}">
<meta name="twitter:site" content="@bluesky" />
<link type="application/activity+json" href="" />
+28 -16
View File
@@ -9,36 +9,48 @@
{% endblock %}
{% block html_head_extra -%}
{%- if profileView -%}
<meta property="og:site_name" content="Bluesky Social">
<meta property="og:type" content="profile">
<meta property="profile:username" content="{{ profileView.Handle }}">
{%- if requestURI %}
{%- if requestURI %}
<meta property="og:url" content="{{ requestURI }}">
<link rel="canonical" href="{{ requestURI|canonicalize_url }}" />
{% endif -%}
{% endif -%}
{%- if profileView -%}
<meta property="profile:username" content="{{ profileView.Handle }}">
{%- if profileView.DisplayName %}
<meta property="og:title" content="{{ profileView.DisplayName }} (@{{ profileView.Handle }})">
{% else %}
<meta property="og:title" content="{{ profileView.Handle }}">
{% endif -%}
{%- if profileView.Description %}
<meta name="description" content="{{ profileView.Description }}">
<meta property="og:description" content="{{ profileView.Description }}">
{% endif -%}
{%- if profileView.Banner %}
<meta property="og:image" content="{{ profileView.Banner }}">
<meta name="twitter:card" content="summary_large_image">
{%- elif profileView.Avatar -%}
{# Don't use avatar image in cards; usually looks bad #}
<meta name="twitter:card" content="summary">
{% endif %}
<link rel="alternate" href="at://{{ profileView.Did }}/app.bsky.actor.profile/self" />
<meta name="twitter:label1" content="Account DID">
<meta name="twitter:value1" content="{{ profileView.Did }}">
{%- if requestHost %}
<link rel="alternate" type="application/rss+xml" href="https://{{ requestHost }}/profile/{{ profileView.Did }}/rss">
{% endif %}
<link rel="alternate" href="at://{{ profileView.Did }}/app.bsky.actor.profile/self" />
{# Only show details if auth isn't required #}
{% if not requiresAuth %}
{%- if profileView.Description %}
<meta name="description" content="{{ profileView.Description }}">
<meta property="og:description" content="{{ profileView.Description }}">
{% endif -%}
{%- if profileView.Banner %}
<meta property="og:image" content="{{ profileView.Banner }}">
<meta name="twitter:card" content="summary_large_image">
{%- elif profileView.Avatar -%}
{# Don't use avatar image in cards; usually looks bad #}
<meta name="twitter:card" content="summary">
{% endif %}
{% else %}
<meta name="description" content="This profile requires authentication to view.">
<meta property="og:description" content="This profile requires authentication to view.">
<meta property="twitter:description" content="This profile requires authentication to view.">
{% endif %}
{% endif -%}
{%- endblock %}