Skip to content

Commit

Permalink
Add generic customization to landing page
Browse files Browse the repository at this point in the history
Allow generic additional HTML or CSS to be added to the landing page
output.
* Fix broken placeholder template.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Mar 30, 2023
1 parent f42e5c7 commit f213b7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/landing_page.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ label {
display: inline-block;
width: {{.Form.Width}}em;
}
{{.ExtraCSS}}
2 changes: 2 additions & 0 deletions web/landing_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down
3 changes: 2 additions & 1 deletion web/landing_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ <h1>{{.Name}}</h1>
<div>
<form action="{{ .Form.Action}}">
{{ range .Form.Inputs }}
<label>{{ .Label }}:</label>&nbsp;<input type="{{ .Type }}" name="{{ .Name }}" placeholder=" .Placeholder }}" value="{{ .Value }}"><br>
<label>{{ .Label }}:</label>&nbsp;<input type="{{ .Type }}" name="{{ .Name }}" placeholder="{{ .Placeholder }}" value="{{ .Value }}"><br>
{{ end }}
<input type="submit" value="Submit">
</form>
</div>
{{ end }}
{{ .ExtraHTML }}
</main>
</body>
</html>

0 comments on commit f213b7f

Please sign in to comment.