all repos — honk @ fd36c9ba19da4b00a5eb76ce2702ff238fabda24

my fork of honk

support hashtags in bios
Ted Unangst tedu@tedunangst.com
Fri, 25 Sep 2020 19:09:01 -0400
commit

fd36c9ba19da4b00a5eb76ce2702ff238fabda24

parent

998b83397c497093dc69ac8dbd04c56c5d68b219

3 files changed, 15 insertions(+), 0 deletions(-)

jump to
M activity.goactivity.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.godatabase.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 }
M honk.gohonk.go

@@ -41,6 +41,7 @@ Name string

Display string About string HTAbout template.HTML + Onts []string Key string URL string Options UserOptions