From f213b7f87b64e79e5a8092f30b870203a698d770 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Thu, 30 Mar 2023 07:56:31 +0200 Subject: [PATCH] Add generic customization to landing page Allow generic additional HTML or CSS to be added to the landing page output. * Fix broken placeholder template. Signed-off-by: SuperQ --- web/landing_page.css | 1 + web/landing_page.go | 2 ++ web/landing_page.html | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/landing_page.css b/web/landing_page.css index 748c821a..260bc8a0 100644 --- a/web/landing_page.css +++ b/web/landing_page.css @@ -15,3 +15,4 @@ label { display: inline-block; width: {{.Form.Width}}em; } +{{.ExtraCSS}} diff --git a/web/landing_page.go b/web/landing_page.go index c755372c..68266213 100644 --- a/web/landing_page.go +++ b/web/landing_page.go @@ -33,6 +33,8 @@ type LandingConfig struct { Description string // A short description about the exporter. Form LandingForm // A POST form. Links []LandingLinks // Links displayed on the landing page. + ExtraHTML string // Additional HTML to be embedded. + ExtraCSS string // Additional CSS to be embedded. Version string // The version displayed. } diff --git a/web/landing_page.html b/web/landing_page.html index bc67d759..4f2e1817 100644 --- a/web/landing_page.html +++ b/web/landing_page.html @@ -23,12 +23,13 @@

{{.Name}}

{{ range .Form.Inputs }} -  
+  
{{ end }}
{{ end }} + {{ .ExtraHTML }}