Skip to content

Commit

Permalink
add preamble
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed May 7, 2019
1 parent 3aea1f5 commit 34ba0f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/dashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ import (
const (
// MainTemplateName is the main template
MainTemplateName = "main.gohtml"
// DashboardTemplateName contains the content of the dashboard
DashboardTemplateName = "dashboard.gohtml"
// HeaderTemplateName contains the navbar
HeaderTemplateName = "header.gohtml"
// PreambleTemplateName contains an empty preamble that can be overridden
PreambleTemplateName = "preamble.gohtml"
// DashboardTemplateName contains the content of the dashboard
DashboardTemplateName = "dashboard.gohtml"
// FooterTemplateName contains the footer
FooterTemplateName = "footer.gohtml"
)
Expand Down Expand Up @@ -78,7 +80,13 @@ func GetBaseTemplate(name string) (*template.Template, error) {
})

templateBox := GetTemplateBox()
templateFileNames := []string{DashboardTemplateName, HeaderTemplateName, FooterTemplateName, MainTemplateName}
templateFileNames := []string{
DashboardTemplateName,
HeaderTemplateName,
PreambleTemplateName,
FooterTemplateName,
MainTemplateName,
}
for _, fname := range templateFileNames {
templateFile, err := templateBox.Find(fname)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/dashboard/templates/preamble.gohtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ define "preamble" }}
{{ end }}

0 comments on commit 34ba0f5

Please sign in to comment.