Svilen Markov 11 месяцев назад
Родитель
Сommit
7ffca9c3f1
2 измененных файлов с 10 добавлено и 4 удалено
  1. 4 0
      internal/assets/templates/page.html
  2. 6 4
      internal/glance/glance.go

+ 4 - 0
internal/assets/templates/page.html

@@ -65,9 +65,13 @@
 
     {{ if not .App.Config.Branding.HideFooter }}
     <div class="footer flex items-center flex-column">
+    {{ if eq "" .App.Config.Branding.CustomFooter }}
         <div>
             <a class="size-h3" href="https://github.com/glanceapp/glance" target="_blank" rel="noreferrer">Glance</a> {{ if ne "dev" .App.Version }}<a class="visited-indicator" title="Release notes" href="https://github.com/glanceapp/glance/releases/tag/{{ .App.Version }}" target="_blank" rel="noreferrer">{{ .App.Version }}</a>{{ else }}({{ .App.Version }}){{ end }}
         </div>
+    {{ else }}
+        {{ .App.Config.Branding.CustomFooter }}
+    {{ end }}
     </div>
     {{ end }}
 

+ 6 - 4
internal/glance/glance.go

@@ -4,6 +4,7 @@ import (
 	"bytes"
 	"context"
 	"fmt"
+	"html/template"
 	"log/slog"
 	"net/http"
 	"path/filepath"
@@ -49,10 +50,11 @@ type Server struct {
 }
 
 type Branding struct {
-	HideFooter bool   `yaml:"hide-footer"`
-	LogoText   string `yaml:"logo-text"`
-	LogoURL    string `yaml:"logo-url"`
-	FaviconURL string `yaml:"favicon-url"`
+	HideFooter   bool          `yaml:"hide-footer"`
+	CustomFooter template.HTML `yaml:"custom-footer"`
+	LogoText     string        `yaml:"logo-text"`
+	LogoURL      string        `yaml:"logo-url"`
+	FaviconURL   string        `yaml:"favicon-url"`
 }
 
 type Column struct {