refactored colors, moved them to separate data/colors.yml

This commit is contained in:
Gabriele Musco 2021-12-24 23:50:58 +01:00
parent 84c245d47c
commit a9b0deb581
No known key found for this signature in database
GPG key ID: 0587A5D65B5DC99E
4 changed files with 160 additions and 88 deletions

View file

@ -4,8 +4,14 @@
"short_name": "{{ .Site.Title }}",
"start_url": "/",
"display": "standalone",
"background_color": "{{ .Site.Params.backgroundColor | default "#242629" }}",
"theme_color": "{{ .Site.Params.accentColor | default "#db5793" }}"
{{ $bg := (.Site.Data.colors.dark.bg | default "#242629") }}
{{ $accent := (.Site.Data.colors.dark.accent | default "#db5793") }}
{{ if eq .Site.Data.colors.default "light" }}
{{ $bg = (.Site.Data.colors.light.bg | default "#f5f5f5") }}
{{ $accent = (.Site.Data.colors.light.accent | default "#db5793") }}
{{ end }}
"background_color": "{{ $bg }}",
"theme_color": "{{ $accent }}"
{{ if .Site.Params.description }}
,
"description": "{{ .Site.Params.description }}"