add oguser
Ted Unangst tedu@tedunangst.com
Sat, 09 Dec 2023 15:57:40 -0500
1 files changed,
17 insertions(+),
0 deletions(-)
jump to
M
web.go
→
web.go
@@ -805,6 +805,7 @@ templinfo := getInfo(r)
templinfo["PageName"] = "user" templinfo["PageArg"] = name templinfo["Name"] = user.Name + templinfo["Honkology"] = oguser(user) templinfo["WhatAbout"] = user.HTAbout templinfo["ServerMessage"] = "" templinfo["APAltLink"] = templates.Sprintf("<link href='%s' rel='alternate' type='application/activity+json'>", user.URL)@@ -1175,6 +1176,22 @@ nextlevel(h)
} } return thread +} + +func oguser(user *WhatAbout) template.HTML { + short := user.About + if len(short) > 160 { + short = short[0:160] + "..." + } + title := user.Display + imgurl := avatarURL(user) + return templates.Sprintf( + `<meta property="og:title" content="%s" /> +<meta property="og:type" content="website" /> +<meta property="og:url" content="%s" /> +<meta property="og:image" content="%s" /> +<meta property="og:description" content="%s" />`, + title, user.URL, imgurl, short) } func honkology(honk *Honk) template.HTML {