all repos — honk @ d2fee4b857e8262b0cbb535411917f741d543227

my fork of honk

add oguser
Ted Unangst tedu@tedunangst.com
Sat, 09 Dec 2023 15:57:40 -0500
commit

d2fee4b857e8262b0cbb535411917f741d543227

parent

2e228abe1b1b3609555ae7f1b249c0c7f2a81bf2

1 files changed, 17 insertions(+), 0 deletions(-)

jump to
M web.goweb.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 {