diff --git a/state.go b/state.go index 1a49aed..1df05ff 100644 --- a/state.go +++ b/state.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "io" + "math/rand" "mime/multipart" "net/http" "net/url" @@ -95,6 +96,7 @@ type State struct { XHR bool Op string Site *lemmy.GetSiteResponse + Tagline string Query string Content string SearchType string @@ -279,6 +281,9 @@ func (state *State) GetSite() { return } state.Site = resp + if len(state.Site.Taglines) > 0 { + state.Tagline = state.Site.Taglines[rand.Intn(len(state.Site.Taglines))].Content + } if !state.Site.MyUser.IsValid() { return } diff --git a/templates/frontpage.html b/templates/frontpage.html index bce44e6..b726f11 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -15,6 +15,9 @@ {{ template "nsfw.html" }} {{ else }}
+ {{ if and (not .Community) .Tagline }} +

{{ markdown .Host .Tagline }}

+ {{ end }} {{ template "menu.html" . }} {{ if .Error }}