support hashtags in bios
Ted Unangst tedu@tedunangst.com
Fri, 25 Sep 2020 19:09:01 -0400
3 files changed,
15 insertions(+),
0 deletions(-)
M
activity.go
→
activity.go
@@ -1418,6 +1418,19 @@ j["outbox"] = user.URL + "/outbox"
j["name"] = user.Display j["preferredUsername"] = user.Name j["summary"] = user.HTAbout + var tags []junk.Junk + for _, o := range user.Onts { + t := junk.New() + t["type"] = "Hashtag" + o = strings.ToLower(o) + t["href"] = fmt.Sprintf("https://%s/o/%s", serverName, o[1:]) + t["name"] = o + tags = append(tags, t) + } + if len(tags) > 0 { + j["tag"] = tags + } + if user.ID > 0 { j["type"] = "Person" j["url"] = user.URL
M
database.go
→
database.go
@@ -59,6 +59,7 @@ var marker mz.Marker
marker.HashLinker = ontoreplacer marker.AtLinker = attoreplacer user.HTAbout = template.HTML(marker.Mark(user.About)) + user.Onts = marker.HashTags return user, nil }