diff options
Diffstat (limited to 'renderer')
-rw-r--r-- | renderer/model.go | 12 | ||||
-rw-r--r-- | renderer/renderer.go | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/renderer/model.go b/renderer/model.go index 9380b7f..2719dbe 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -97,3 +97,15 @@ func NewAboutPageTemplateData(navbarData *NavbarTemplateData) *AboutPageTemplate NavbarData: navbarData, } } + +type EmojiPageTemplateData struct { + NavbarData *NavbarTemplateData + Emojis []*mastodon.Emoji +} + +func NewEmojiPageTemplateData(navbarData *NavbarTemplateData, emojis []*mastodon.Emoji) *EmojiPageTemplateData { + return &EmojiPageTemplateData{ + NavbarData: navbarData, + Emojis: emojis, + } +} diff --git a/renderer/renderer.go b/renderer/renderer.go index 8009d99..4415b0b 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -20,6 +20,7 @@ type Renderer interface { RenderNotificationPage(ctx context.Context, writer io.Writer, data *NotificationPageTemplateData) (err error) RenderUserPage(ctx context.Context, writer io.Writer, data *UserPageTemplateData) (err error) RenderAboutPage(ctx context.Context, writer io.Writer, data *AboutPageTemplateData) (err error) + RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiPageTemplateData) (err error) } type renderer struct { @@ -76,6 +77,10 @@ func (r *renderer) RenderAboutPage(ctx context.Context, writer io.Writer, data * return r.template.ExecuteTemplate(writer, "about.tmpl", data) } +func (r *renderer) RenderEmojiPage(ctx context.Context, writer io.Writer, data *EmojiPageTemplateData) (err error) { + return r.template.ExecuteTemplate(writer, "emoji.tmpl", data) +} + func EmojiFilter(content string, emojis []mastodon.Emoji) string { var replacements []string for _, e := range emojis { |