mirror of
https://github.com/yrzam/yrzam-hugo-theme.git
synced 2025-04-19 12:19:09 +00:00
change config format
This commit is contained in:
parent
dca9541eee
commit
6fac717306
@ -1,4 +1,12 @@
|
||||
@import "variables.scss";
|
||||
$color-fg: #{{ .Site.Data.theme.color.fg }};
|
||||
$color-fg-dark: #{{ .Site.Data.theme.color.fg_dark }};
|
||||
$color-fg-accent: #{{ .Site.Data.theme.color.fg_accent }};
|
||||
$color-bg: #{{ .Site.Data.theme.color.bg }};
|
||||
$color-bg-accent-light: #{{ .Site.Data.theme.color.bg_accent_light }};
|
||||
$color-bg-accent-dark: #{{ .Site.Data.theme.color.bg_accent_dark }};
|
||||
$opacity-low: {{ .Site.Data.theme.opacity.low }};
|
||||
$opacity-mid: {{ .Site.Data.theme.opacity.med }};
|
||||
|
||||
@import "basic.scss";
|
||||
@import "classic-layout.scss";
|
||||
@import "home-layout.scss";
|
||||
|
@ -1,9 +0,0 @@
|
||||
$color-fg: #ffffff;
|
||||
$color-fg-dark: #b8bcc1;
|
||||
$color-fg-accent: #9988ff;
|
||||
$color-bg: #0d1117;
|
||||
$color-bg-accent-light: #510079;
|
||||
$color-bg-accent-dark: #020030;
|
||||
|
||||
$opacity-low: 0.2;
|
||||
$opacity-mid: 0.55;
|
21
data/theme.json
Normal file
21
data/theme.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"color": {
|
||||
"fg": "ffffff",
|
||||
"fg_dark": "b8bcc1",
|
||||
"fg_accent": "9988ff",
|
||||
"bg": "0d1117",
|
||||
"bg_accent_light":"510079",
|
||||
"bg_accent_dark":"020030"
|
||||
},
|
||||
"opacity": {
|
||||
"low": 0.2,
|
||||
"med": 0.55,
|
||||
"high": 0.85
|
||||
},
|
||||
"font": {
|
||||
"name_regular": "Roboto",
|
||||
"name_mono": "Roboto Mono",
|
||||
"size_base_pt": 12,
|
||||
"size_step_pt": 1.5
|
||||
}
|
||||
}
|
@ -1,12 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
[ -d ./themes/yrzam ] && cd ./themes/yrzam
|
||||
|
||||
VARS=$(printenv | \
|
||||
grep -E 'THEME_.*' | \
|
||||
sed -e 's/[= ].*//g' | sed -e 's/^/\$/' | tr '\n' ' '
|
||||
)
|
||||
|
||||
envsubst "$VARS" < "./assets/css/variables.scss.tmpl" > "./assets/css/variables.scss"
|
||||
cp ~/.config/theme.json ../data/theme.json
|
||||
|
@ -6,7 +6,7 @@
|
||||
<!-- prettier-ignore -->
|
||||
<title>{{ if not .IsHome }}{{ .LinkTitle | humanize }} - {{ end }}{{ .Site.Title }}</title>
|
||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "_style.css" }}
|
||||
{{ with resources.Get "css/index.scss" | toCSS $opts | minify | fingerprint }}
|
||||
{{ with resources.Get "css/index.scss" | resources.ExecuteAsTemplate "" . | toCSS $opts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" />
|
||||
{{ end }}
|
||||
{{ range resources.Match "favicon/*.png" }}
|
||||
|
Loading…
Reference in New Issue
Block a user