diff --git a/cmd/init.go b/cmd/init.go index a503c75..c5011ea 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -49,6 +49,7 @@ const ( // constants contains static, constant config values required by the app. type constants struct { + SiteName string `koanf:"site_name"` RootURL string `koanf:"root_url"` LogoURL string `koanf:"logo_url"` FaviconURL string `koanf:"favicon_url"` @@ -693,6 +694,7 @@ func initHTTPServer(app *App) *echo.Echo { } srv.Renderer = &tplRenderer{ templates: tpl, + SiteName: app.constants.SiteName, RootURL: app.constants.RootURL, LogoURL: app.constants.LogoURL, FaviconURL: app.constants.FaviconURL, diff --git a/cmd/public.go b/cmd/public.go index ea764ed..89d5c99 100644 --- a/cmd/public.go +++ b/cmd/public.go @@ -26,6 +26,7 @@ const ( // tplRenderer wraps a template.tplRenderer for echo. type tplRenderer struct { templates *template.Template + SiteName string RootURL string LogoURL string FaviconURL string @@ -35,6 +36,7 @@ type tplRenderer struct { // tplData is the data container that is injected // into public templates for accessing data. type tplData struct { + SiteName string RootURL string LogoURL string FaviconURL string @@ -85,6 +87,7 @@ var ( // Render executes and renders a template for echo. func (t *tplRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error { return t.templates.ExecuteTemplate(w, name, tplData{ + SiteName: t.SiteName, RootURL: t.RootURL, LogoURL: t.LogoURL, FaviconURL: t.FaviconURL, diff --git a/frontend/src/views/settings/general.vue b/frontend/src/views/settings/general.vue index 890f47e..d8d8fdb 100644 --- a/frontend/src/views/settings/general.vue +++ b/frontend/src/views/settings/general.vue @@ -1,9 +1,14 @@