mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-22 08:23:52 +01:00
Allow some branding customization.
This commit is contained in:
parent
21d491843f
commit
3cfbe0c89b
@ -3,6 +3,7 @@
|
|||||||
- [Intro](#intro)
|
- [Intro](#intro)
|
||||||
- [Preconfigured page](#preconfigured-page)
|
- [Preconfigured page](#preconfigured-page)
|
||||||
- [Server](#server)
|
- [Server](#server)
|
||||||
|
- [Branding](#branding)
|
||||||
- [Theme](#theme)
|
- [Theme](#theme)
|
||||||
- [Themes](#themes)
|
- [Themes](#themes)
|
||||||
- [Pages & Columns](#pages--columns)
|
- [Pages & Columns](#pages--columns)
|
||||||
@ -162,6 +163,33 @@ To be able to point to an asset from your assets path, use the `/assets/` path l
|
|||||||
icon: /assets/gitea-icon.png
|
icon: /assets/gitea-icon.png
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Branding
|
||||||
|
You can adjust the various parts of the branding through a top level `branding` property. Example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
branding:
|
||||||
|
show: true
|
||||||
|
name: Glance
|
||||||
|
short-name: G
|
||||||
|
```
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Name | Type | Required | Default |
|
||||||
|
| ---- | ---- | -------- | ------- |
|
||||||
|
| show | bool | no | true |
|
||||||
|
| name | string | no | Glance |
|
||||||
|
| short-name | string | no | G |
|
||||||
|
|
||||||
|
#### `show`
|
||||||
|
True will show the glance footer, false will hide it.
|
||||||
|
|
||||||
|
#### `name`
|
||||||
|
Sets the name presented after the page name in the title.
|
||||||
|
|
||||||
|
#### `short-name`
|
||||||
|
Sets the name presented before the pages in the header.
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
Theming is done through a top level `theme` property. Values for the colors are in [HSL](https://giggster.com/guide/basics/hue-saturation-lightness/) (hue, saturation, lightness) format. You can use a color picker [like this one](https://hslpicker.com/) to convert colors from other formats to HSL. The values are separated by a space and `%` is not required for any of the numbers.
|
Theming is done through a top level `theme` property. Values for the colors are in [HSL](https://giggster.com/guide/basics/hue-saturation-lightness/) (hue, saturation, lightness) format. You can use a color picker [like this one](https://hslpicker.com/) to convert colors from other formats to HSL. The values are separated by a space and `%` is not required for any of the numbers.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{ template "document.html" . }}
|
{{ template "document.html" . }}
|
||||||
|
|
||||||
{{ define "document-title" }}{{ .Page.Title }} - Glance{{ end }}
|
{{ define "document-title" }}{{ .Page.Title }} - {{ .App.Config.Branding.Name }}{{ end }}
|
||||||
|
|
||||||
{{ define "document-head-before" }}
|
{{ define "document-head-before" }}
|
||||||
<script>
|
<script>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<div class="header-container content-bounds">
|
<div class="header-container content-bounds">
|
||||||
<div class="header flex padding-inline-widget widget-content-frame">
|
<div class="header flex padding-inline-widget widget-content-frame">
|
||||||
<!-- TODO: Replace G with actual logo, first need an actual logo -->
|
<!-- TODO: Replace G with actual logo, first need an actual logo -->
|
||||||
<div class="logo">G</div>
|
<div class="logo">{{ .App.Config.Branding.ShortName }}</div>
|
||||||
<div class="nav flex grow">
|
<div class="nav flex grow">
|
||||||
{{ template "navigation-links" . }}
|
{{ template "navigation-links" . }}
|
||||||
</div>
|
</div>
|
||||||
@ -57,6 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ if .App.Config.Branding.Show }}
|
||||||
<div class="footer flex items-center flex-column">
|
<div class="footer flex items-center flex-column">
|
||||||
<div>
|
<div>
|
||||||
<span class="size-h3">Glance</span> ({{ .App.Version }})
|
<span class="size-h3">Glance</span> ({{ .App.Version }})
|
||||||
@ -67,3 +68,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
@ -8,9 +8,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Server Server `yaml:"server"`
|
Server Server `yaml:"server"`
|
||||||
Theme Theme `yaml:"theme"`
|
Theme Theme `yaml:"theme"`
|
||||||
Pages []Page `yaml:"pages"`
|
Pages []Page `yaml:"pages"`
|
||||||
|
Branding Branding `yaml:"branding"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfigFromYml(contents io.Reader) (*Config, error) {
|
func NewConfigFromYml(contents io.Reader) (*Config, error) {
|
||||||
@ -40,6 +41,9 @@ func NewConfig() *Config {
|
|||||||
|
|
||||||
config.Server.Host = ""
|
config.Server.Host = ""
|
||||||
config.Server.Port = 8080
|
config.Server.Port = 8080
|
||||||
|
config.Branding.Show = true
|
||||||
|
config.Branding.Name = "Glance"
|
||||||
|
config.Branding.ShortName = "G"
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,16 @@ type Theme struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
Host string `yaml:"host"`
|
Host string `yaml:"host"`
|
||||||
Port uint16 `yaml:"port"`
|
Port uint16 `yaml:"port"`
|
||||||
AssetsPath string `yaml:"assets-path"`
|
AssetsPath string `yaml:"assets-path"`
|
||||||
StartedAt time.Time `yaml:"-"`
|
StartedAt time.Time `yaml:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Branding struct {
|
||||||
|
Show bool `yaml:show`
|
||||||
|
Name string `yaml:name`
|
||||||
|
ShortName string `yaml:"short-name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Column struct {
|
type Column struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user