2022-07-16 22:20:56 +01:00
|
|
|
package index
|
|
|
|
|
2022-07-27 01:16:37 +01:00
|
|
|
import "html/template"
|
|
|
|
|
2022-07-16 22:20:56 +01:00
|
|
|
type DataYaml struct {
|
2022-07-27 13:45:44 +01:00
|
|
|
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"`
|
|
|
|
NoVideoImageLocation template.URL `yaml:"noVideoImageLocation"`
|
2022-07-27 17:34:49 +01:00
|
|
|
LogoImageLocation template.URL `yaml:"logoImageLocation"`
|
|
|
|
SunImageLocation template.URL `yaml:"sunImageLocation"`
|
|
|
|
MoonImageLocation template.URL `yaml:"moonImageLocation"`
|
2022-07-27 13:45:44 +01:00
|
|
|
About AboutYaml `yaml:"about"`
|
|
|
|
Entries []EntryYaml `yaml:"entries"`
|
2022-07-25 15:39:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2022-07-27 01:16:37 +01:00
|
|
|
func (dy DataYaml) GetHeaderLink(headerLabel string) template.URL {
|
2022-07-25 15:39:05 +01:00
|
|
|
if dy.HeaderLinks == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return dy.HeaderLinks[headerLabel]
|
2022-07-16 22:20:56 +01:00
|
|
|
}
|