mirror of
https://github.com/ordinary-dev/phoenix
synced 2024-09-20 03:40:29 +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,
|
linear-gradient(90deg, #1d1926 19px, transparent 1px) center,
|
||||||
#7a7093;
|
#7a7093;
|
||||||
background-size: 20px 20px;
|
background-size: 20px 20px;
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ type Config struct {
|
||||||
SecureCookie bool `default:"true"`
|
SecureCookie bool `default:"true"`
|
||||||
|
|
||||||
Title string `default:"Phoenix"`
|
Title string `default:"Phoenix"`
|
||||||
|
// Any supported css value, embedded directly into every page.
|
||||||
|
FontFamily string `default:"sans-serif"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfig() (*Config, error) {
|
func GetConfig() (*Config, error) {
|
||||||
|
|
|
@ -31,7 +31,8 @@ Service settings can be set through environment variables.
|
||||||
Appearance settings:
|
Appearance settings:
|
||||||
| Variable | Description | Default |
|
| 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
|
## Docker-compose example
|
||||||
```yml
|
```yml
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
{{template "head"}}
|
{{template "head" .}}
|
||||||
<link rel="stylesheet" href="assets/css/auth.css" />
|
<link rel="stylesheet" href="assets/css/auth.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
{{template "head"}}
|
{{template "head" .}}
|
||||||
<link rel="stylesheet" href="assets/css/error.css" />
|
<link rel="stylesheet" href="assets/css/error.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -8,4 +8,9 @@
|
||||||
<link rel="icon" type="image/png" href="/assets/favicons/favicon-32.png" sizes="32x32" />
|
<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="icon" type="image/svg+xml" href="/assets/favicons/favicon.svg" />
|
||||||
<link rel="apple-touch-icon" href="/assets/favicons/favicon-180.png" />
|
<link rel="apple-touch-icon" href="/assets/favicons/favicon-180.png" />
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: {{.FontFamily}};
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
{{template "head"}}
|
{{template "head" .}}
|
||||||
<link rel="stylesheet" href="assets/css/index.css" />
|
<link rel="stylesheet" href="assets/css/index.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
{{template "head"}}
|
{{template "head" .}}
|
||||||
<link rel="stylesheet" href="assets/css/settings.css" />
|
<link rel="stylesheet" href="assets/css/settings.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -8,5 +8,6 @@ import (
|
||||||
// Fill in the necessary parameters from the settings and output html.
|
// 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) {
|
func Render(ctx *gin.Context, cfg *config.Config, status int, templatePath string, params map[string]any) {
|
||||||
params["WebsiteTitle"] = cfg.Title
|
params["WebsiteTitle"] = cfg.Title
|
||||||
|
params["FontFamily"] = cfg.FontFamily
|
||||||
ctx.HTML(status, templatePath, params)
|
ctx.HTML(status, templatePath, params)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue