Move template vars
This commit is contained in:
parent
6886716e67
commit
03035d1a2d
3 changed files with 8 additions and 8 deletions
|
@ -14,7 +14,11 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var pageThemeStyleTemplate = mustParseTemplate("theme-style.gotmpl")
|
||||
var (
|
||||
pageTemplate = mustParseTemplate("page.html", "document.html")
|
||||
pageContentTemplate = mustParseTemplate("page-content.html")
|
||||
pageThemeStyleTemplate = mustParseTemplate("theme-style.gotmpl")
|
||||
)
|
||||
|
||||
type application struct {
|
||||
Version string
|
||||
|
|
|
@ -11,11 +11,7 @@ import (
|
|||
"golang.org/x/text/message"
|
||||
)
|
||||
|
||||
var (
|
||||
pageTemplate = mustParseTemplate("page.html", "document.html")
|
||||
pageContentTemplate = mustParseTemplate("page-content.html")
|
||||
forumPostsTemplate = mustParseTemplate("forum-posts.html", "widget-base.html")
|
||||
)
|
||||
var intl = message.NewPrinter(language.English)
|
||||
|
||||
var globalTemplateFunctions = template.FuncMap{
|
||||
"formatViewerCount": formatViewerCount,
|
||||
|
@ -43,8 +39,6 @@ func mustParseTemplate(primary string, dependencies ...string) *template.Templat
|
|||
return t
|
||||
}
|
||||
|
||||
var intl = message.NewPrinter(language.English)
|
||||
|
||||
func formatViewerCount(count int) string {
|
||||
if count < 1_000 {
|
||||
return strconv.Itoa(count)
|
||||
|
|
|
@ -9,6 +9,8 @@ import (
|
|||
const twitchGqlEndpoint = "https://gql.twitch.tv/gql"
|
||||
const twitchGqlClientId = "kimne78kx3ncx6brgo4mv6wki5h1ko"
|
||||
|
||||
var forumPostsTemplate = mustParseTemplate("forum-posts.html", "widget-base.html")
|
||||
|
||||
type forumPost struct {
|
||||
Title string
|
||||
DiscussionUrl string
|
||||
|
|
Loading…
Add table
Reference in a new issue