diff --git a/renderer/renderer.go b/renderer/renderer.go index 7afeb14..cef03bb 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -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 `` } @@ -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, diff --git a/templates/emoji.tmpl b/templates/emoji.tmpl index 4b07e81..e3ba8a0 100644 --- a/templates/emoji.tmpl +++ b/templates/emoji.tmpl @@ -4,6 +4,7 @@