improve profile card

This commit is contained in:
Hailey
2025-09-18 10:54:00 -07:00
parent ac71ea235f
commit 006d813291
3 changed files with 38 additions and 19 deletions
+9 -3
View File
@@ -394,6 +394,9 @@ 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", "https://bsky.app"),
// specify the default image for social cards
"defaultBannerImage": fmt.Sprintf("%s/static/social-card-default.png", srv.cfg.staticCDNHost),
}
}
@@ -599,13 +602,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)
}