mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Move template vars
This commit is contained in:
parent
6886716e67
commit
03035d1a2d
@ -14,7 +14,11 @@ import (
|
|||||||
"time"
|
"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 {
|
type application struct {
|
||||||
Version string
|
Version string
|
||||||
|
@ -11,11 +11,7 @@ import (
|
|||||||
"golang.org/x/text/message"
|
"golang.org/x/text/message"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var intl = message.NewPrinter(language.English)
|
||||||
pageTemplate = mustParseTemplate("page.html", "document.html")
|
|
||||||
pageContentTemplate = mustParseTemplate("page-content.html")
|
|
||||||
forumPostsTemplate = mustParseTemplate("forum-posts.html", "widget-base.html")
|
|
||||||
)
|
|
||||||
|
|
||||||
var globalTemplateFunctions = template.FuncMap{
|
var globalTemplateFunctions = template.FuncMap{
|
||||||
"formatViewerCount": formatViewerCount,
|
"formatViewerCount": formatViewerCount,
|
||||||
@ -43,8 +39,6 @@ func mustParseTemplate(primary string, dependencies ...string) *template.Templat
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
var intl = message.NewPrinter(language.English)
|
|
||||||
|
|
||||||
func formatViewerCount(count int) string {
|
func formatViewerCount(count int) string {
|
||||||
if count < 1_000 {
|
if count < 1_000 {
|
||||||
return strconv.Itoa(count)
|
return strconv.Itoa(count)
|
||||||
|
@ -9,6 +9,8 @@ import (
|
|||||||
const twitchGqlEndpoint = "https://gql.twitch.tv/gql"
|
const twitchGqlEndpoint = "https://gql.twitch.tv/gql"
|
||||||
const twitchGqlClientId = "kimne78kx3ncx6brgo4mv6wki5h1ko"
|
const twitchGqlClientId = "kimne78kx3ncx6brgo4mv6wki5h1ko"
|
||||||
|
|
||||||
|
var forumPostsTemplate = mustParseTemplate("forum-posts.html", "widget-base.html")
|
||||||
|
|
||||||
type forumPost struct {
|
type forumPost struct {
|
||||||
Title string
|
Title string
|
||||||
DiscussionUrl string
|
DiscussionUrl string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user