mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-04 10:58:48 +00:00
Manual selecting emojis on page by codes contain
This commit is contained in:
parent
5f688c6318
commit
f219ac0dca
2 changed files with 13 additions and 0 deletions
|
@ -40,6 +40,16 @@ type TemplateData struct {
|
|||
Ctx *Context
|
||||
}
|
||||
|
||||
|
||||
func allowed_emoji_page(emoj string, codes ...string) bool {
|
||||
for _, code := range codes {
|
||||
if strings.Contains(emoj, code) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func emojiHTML(e mastodon.Emoji, height string) string {
|
||||
return `<img class="emoji" src="` + e.URL + `" alt=":` + e.ShortCode + `:" title=":` + e.ShortCode + `:" height="` + height + `"/>`
|
||||
}
|
||||
|
@ -142,6 +152,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) {
|
|||
t := template.New("default")
|
||||
t, err = t.Funcs(template.FuncMap{
|
||||
"EmojiFilter": emojiFilter,
|
||||
"Allowed_emoji_page": allowed_emoji_page,
|
||||
"StatusContentFilter": statusContentFilter,
|
||||
"DisplayInteractionCount": displayInteractionCount,
|
||||
"TimeSince": timeSince,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue