mirror of
https://github.com/ordinary-dev/phoenix
synced 2024-09-19 19:30:28 +05:00
Add appearance settings
This commit is contained in:
parent
00dcd04eb7
commit
9d269ba79f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "head"}}
|
||||
{{template "head" .}}
|
||||
<link rel="stylesheet" href="assets/css/auth.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "head"}}
|
||||
{{template "head" .}}
|
||||
<link rel="stylesheet" href="assets/css/error.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,4 +8,9 @@
|
|||
<link rel="icon" type="image/png" href="/assets/favicons/favicon-32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/favicons/favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="/assets/favicons/favicon-180.png" />
|
||||
<style>
|
||||
body {
|
||||
font-family: {{.FontFamily}};
|
||||
}
|
||||
</style>
|
||||
{{end}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "head"}}
|
||||
{{template "head" .}}
|
||||
<link rel="stylesheet" href="assets/css/index.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{template "head"}}
|
||||
{{template "head" .}}
|
||||
<link rel="stylesheet" href="assets/css/settings.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue