Fix url parameters.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Captain ALM 2022-07-27 01:16:37 +01:00
parent b4ff56e7ca
commit 7d68f0be91
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
5 changed files with 34 additions and 29 deletions

View File

@ -10,8 +10,8 @@ import (
type AboutYaml struct { type AboutYaml struct {
Title string `yaml:"title"` Title string `yaml:"title"`
Content string `yaml:"content"` Content string `yaml:"content"`
ThumbnailLocation string `yaml:"thumbnailLocation"` ThumbnailLocation template.URL `yaml:"thumbnailLocation"`
ImageLocation string `yaml:"imageLocation"` ImageLocation template.URL `yaml:"imageLocation"`
ImageAltText string `yaml:"imageAltText"` ImageAltText string `yaml:"imageAltText"`
BirthYear int `yaml:"birthYear"` BirthYear int `yaml:"birthYear"`
ContactEmail string `yaml:"contactEmail"` ContactEmail string `yaml:"contactEmail"`

View File

@ -1,11 +1,13 @@
package index package index
import "html/template"
type DataYaml struct { type DataYaml struct {
HeaderLinks map[string]string `yaml:"headerLinks"` HeaderLinks map[string]template.URL `yaml:"headerLinks"`
CSSBaseURL string `yaml:"cssBaseURL"` CSSBaseURL template.URL `yaml:"cssBaseURL"`
CSSLightURL string `yaml:"cssLightURL"` CSSLightURL template.URL `yaml:"cssLightURL"`
CSSDarkURL string `yaml:"cssDarkURL"` CSSDarkURL template.URL `yaml:"cssDarkURL"`
JScriptURL string `yaml:"jScriptURL"` JScriptURL template.URL `yaml:"jScriptURL"`
About AboutYaml `yaml:"about"` About AboutYaml `yaml:"about"`
Entries []EntryYaml `yaml:"entries"` Entries []EntryYaml `yaml:"entries"`
} }
@ -23,7 +25,7 @@ func (dy DataYaml) GetHeaderLabels() []string {
return toReturn return toReturn
} }
func (dy DataYaml) GetHeaderLink(headerLabel string) string { func (dy DataYaml) GetHeaderLink(headerLabel string) template.URL {
if dy.HeaderLinks == nil { if dy.HeaderLinks == nil {
return "" return ""
} }

View File

@ -14,16 +14,16 @@ type EntryYaml struct {
Content string `yaml:"content"` Content string `yaml:"content"`
StartDate yaml.DateType `yaml:"startDate"` StartDate yaml.DateType `yaml:"startDate"`
EndDate yaml.DateType `yaml:"endDate"` EndDate yaml.DateType `yaml:"endDate"`
VideoLocation string `yaml:"videoLocation"` VideoLocation template.URL `yaml:"videoLocation"`
VideoContentType string `yaml:"videoContentType"` VideoContentType string `yaml:"videoContentType"`
ThumbnailLocations []string `yaml:"thumbnailLocations"` ThumbnailLocations []template.URL `yaml:"thumbnailLocations"`
ImageLocations []string `yaml:"imageLocations"` ImageLocations []template.URL `yaml:"imageLocations"`
ImageAltTexts []string `yaml:"imageAltTexts"` ImageAltTexts []string `yaml:"imageAltTexts"`
} }
type ImageReference struct { type ImageReference struct {
ThumbnailLocation string ThumbnailLocation template.URL
ImageLocation string ImageLocation template.URL
ImageAltText string ImageAltText string
} }

View File

@ -90,7 +90,7 @@ func (p *Page) GetContents(urlParameters url.Values) (contentType string, conten
theMarshal := &Marshal{ theMarshal := &Marshal{
Data: *theData, Data: *theData,
Light: urlParameters.Has("light"), Light: urlParameters.Has("light"),
Parameters: p.getNonThemedCleanQuery(urlParameters), Parameters: template.URL(p.getNonThemedCleanQuery(urlParameters)),
} }
switch strings.ToLower(urlParameters.Get("order")) { switch strings.ToLower(urlParameters.Get("order")) {
case "end": case "end":

View File

@ -1,10 +1,13 @@
package index package index
import "sort" import (
"html/template"
"sort"
)
type Marshal struct { type Marshal struct {
Data DataYaml Data DataYaml
Parameters string Parameters template.URL
OrderStartDate int8 OrderStartDate int8
OrderEndDate int8 OrderEndDate int8
OrderName int8 OrderName int8