From b0a86973a3816335d3410b9e7f22bf1346857d7d Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sun, 10 Nov 2024 01:41:27 +0100 Subject: style(data): rename data with config --- data.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'data.go') diff --git a/data.go b/data.go index d085b99..4ccae88 100644 --- a/data.go +++ b/data.go @@ -6,7 +6,7 @@ import ( "strconv" ) -type Data struct { +type Config struct { Image string `json:"image"` Description string `json:"description"` Person *Person `json:"person"` @@ -49,8 +49,8 @@ type Legal struct { ImagesSource []string `json:"images_source"` } -func (d *Data) GetBackground() template.CSS { - bg := d.Color.Background +func (c *Config) GetBackground() template.CSS { + bg := c.Color.Background css := "background: " + bg.Type + "-gradient(" if bg.Type == "linear" { css += strconv.Itoa(int(bg.Angle)) + "deg," @@ -61,12 +61,12 @@ func (d *Data) GetBackground() template.CSS { return template.CSS(css[:len(css)-1] + ");") } -func (d *Data) GetBackgroundImage() template.CSS { - return template.CSS("--background-image: url(" + golatt.GetStaticPath(d.Image) + ");") +func (c *Config) GetBackgroundImage() template.CSS { + return template.CSS("--background-image: url(" + golatt.GetStaticPath(c.Image) + ");") } -func (d *Data) GetTextColor() template.CSS { - return template.CSS("--text-color: " + d.Color.Text + ";") +func (c *Config) GetTextColor() template.CSS { + return template.CSS("--text-color: " + c.Color.Text + ";") } func (l *Link) GetLinkColor() template.CSS { -- cgit v1.2.3