cityuni-webserver/pageHandler/pages/index/data.go
Captain ALM dba4022bf4
All checks were successful
continuous-integration/drone/push Build is passing
Update layout for full flex-box with table fallback.
Fix up sort drop down css and html.
Resize nav bar.
Round some objects.
Add copyright messages.
2022-07-29 22:34:12 +01:00

40 lines
1.3 KiB
Go

package index
import "html/template"
type DataYaml struct {
HeaderLinks map[string]template.URL `yaml:"headerLinks"`
CSSBaseURL template.URL `yaml:"cssBaseURL"`
CSSLightURL template.URL `yaml:"cssLightURL"`
CSSDarkURL template.URL `yaml:"cssDarkURL"`
JScriptURL template.URL `yaml:"jScriptURL"`
PlayVideoImageLocation template.URL `yaml:"playVideoImageLocation"`
NoVideoImageLocation template.URL `yaml:"noVideoImageLocation"`
LogoImageLocation template.URL `yaml:"logoImageLocation"`
SunImageLocation template.URL `yaml:"sunImageLocation"`
MoonImageLocation template.URL `yaml:"moonImageLocation"`
SortImageLocation template.URL `yaml:"sortImageLocation"`
About AboutYaml `yaml:"about"`
Entries []EntryYaml `yaml:"entries"`
}
func (dy DataYaml) GetHeaderLabels() []string {
if dy.HeaderLinks == nil {
return []string{}
}
toReturn := make([]string, len(dy.HeaderLinks))
i := 0
for key := range dy.HeaderLinks {
toReturn[i] = key
i++
}
return toReturn
}
func (dy DataYaml) GetHeaderLink(headerLabel string) template.URL {
if dy.HeaderLinks == nil {
return ""
}
return dy.HeaderLinks[headerLabel]
}