diff --git a/README.md b/README.md index d2eff2f..e37d4fb 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ the static website will be copied and `-config-file` is the path to the configur ```yaml title: "go-gallery" url: https://photos.example.org +#cover_url: https://example.org/cover.png <- override the default cover bg_color: "#1b1c1d" font_color: "white" border: "3px" diff --git a/config.yaml.example b/config.yaml.example index c5563a7..bbedee9 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -1,5 +1,6 @@ title: "go-gallery" url: https://photos.example.org +#cover_url: https://example.org/cover.png <- override the default cover bg_color: "#1b1c1d" font_color: "white" border: "3px" diff --git a/gallery.go b/gallery.go index 2868599..e0aba3b 100644 --- a/gallery.go +++ b/gallery.go @@ -45,6 +45,7 @@ var ( type config struct { Title string `yaml:"title"` URL string `yaml:"url"` + CoverURL string `yaml:"cover_url"` BgColor string `yaml:"bg_color"` FontColor string `yaml:"font_color"` Border string `yaml:"border"` diff --git a/res/index.html.tmpl b/res/index.html.tmpl index 8dc2528..cb26241 100644 --- a/res/index.html.tmpl +++ b/res/index.html.tmpl @@ -14,9 +14,13 @@ - - + + {{ if .Config.CoverURL }} + + {{ else }} + + {{ end }}