diff --git a/assets/css/base.css b/assets/css/base.css index c6c1f39..30d263d 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -10,7 +10,6 @@ body { linear-gradient(90deg, #1d1926 19px, transparent 1px) center, #7a7093; background-size: 20px 20px; - font-family: sans-serif; font-size: 16px; color: white; } diff --git a/config/main.go b/config/main.go index 5e6be25..be3e7e6 100644 --- a/config/main.go +++ b/config/main.go @@ -19,6 +19,8 @@ type Config struct { SecureCookie bool `default:"true"` Title string `default:"Phoenix"` + // Any supported css value, embedded directly into every page. + FontFamily string `default:"sans-serif"` } func GetConfig() (*Config, error) { diff --git a/readme.md b/readme.md index bf841f9..0ccad97 100644 --- a/readme.md +++ b/readme.md @@ -31,7 +31,8 @@ Service settings can be set through environment variables. Appearance settings: | Variable | Description | Default | | --- | --- | --- | -| P_TITLE | Website title | Phoenix | +| P_TITLE | Website title | `Phoenix` | +| P_FONTFAMILY | The font used on the site. Inserted directly into css. | `sans-serif` | ## Docker-compose example ```yml diff --git a/templates/auth.html.tmpl b/templates/auth.html.tmpl index 0e47abd..bd0163c 100644 --- a/templates/auth.html.tmpl +++ b/templates/auth.html.tmpl @@ -1,7 +1,7 @@ - {{template "head"}} + {{template "head" .}} diff --git a/templates/error.html.tmpl b/templates/error.html.tmpl index c0c0a54..aa42b42 100644 --- a/templates/error.html.tmpl +++ b/templates/error.html.tmpl @@ -1,7 +1,7 @@ - {{template "head"}} + {{template "head" .}} diff --git a/templates/head.html.tmpl b/templates/head.html.tmpl index a9013e8..3487400 100644 --- a/templates/head.html.tmpl +++ b/templates/head.html.tmpl @@ -8,4 +8,9 @@ + {{end}} diff --git a/templates/index.html.tmpl b/templates/index.html.tmpl index 39ebe84..e3550ab 100644 --- a/templates/index.html.tmpl +++ b/templates/index.html.tmpl @@ -1,7 +1,7 @@ - {{template "head"}} + {{template "head" .}} diff --git a/templates/settings.html.tmpl b/templates/settings.html.tmpl index 8fe8f1a..c2cf34c 100644 --- a/templates/settings.html.tmpl +++ b/templates/settings.html.tmpl @@ -1,7 +1,7 @@ - {{template "head"}} + {{template "head" .}} diff --git a/views/render.go b/views/render.go index 1bdd38a..81d2a69 100644 --- a/views/render.go +++ b/views/render.go @@ -8,5 +8,6 @@ import ( // Fill in the necessary parameters from the settings and output html. func Render(ctx *gin.Context, cfg *config.Config, status int, templatePath string, params map[string]any) { params["WebsiteTitle"] = cfg.Title + params["FontFamily"] = cfg.FontFamily ctx.HTML(status, templatePath, params) }