diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/router/template.go | 11 | ||||
-rw-r--r-- | internal/web/base.go | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/internal/router/template.go b/internal/router/template.go index 06ba85e2f..d8b5b5edd 100644 --- a/internal/router/template.go +++ b/internal/router/template.go @@ -22,6 +22,7 @@ import ( "html/template" "os" "path/filepath" + "strings" "time" "github.com/gin-gonic/gin" @@ -158,6 +159,15 @@ func emojify(emojis []apimodel.Emoji, inputText template.HTML) template.HTML { return template.HTML(out) } +func acctInstance(acct string) string { + parts := strings.Split(acct, "@") + if len(parts) > 1 { + return "@" + parts[1] + } + + return "" +} + func LoadTemplateFunctions(engine *gin.Engine) { engine.SetFuncMap(template.FuncMap{ "escape": escape, @@ -169,5 +179,6 @@ func LoadTemplateFunctions(engine *gin.Engine) { "timestampVague": timestampVague, "timestampPrecise": timestampPrecise, "emojify": emojify, + "acctInstance": acctInstance, }) } diff --git a/internal/web/base.go b/internal/web/base.go index 92bc6f0ae..7e8bcf48f 100644 --- a/internal/web/base.go +++ b/internal/web/base.go @@ -43,5 +43,8 @@ func (m *Module) baseHandler(c *gin.Context) { c.HTML(http.StatusOK, "index.tmpl", gin.H{ "instance": instance, "ogMeta": ogBase(instance), + "stylesheets": []string{ + distPathPrefix + "/index.css", + }, }) } |