diff --git a/README.md b/README.md index e4a54a7..b3e1ddf 100755 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ Available options to `config.toml`: disqusShortname = 'YOUR_DISQUS_SHORTNAME' # add disqus comments [params] - # color theme - theme = 'gray' # gray, light, linen, wheat + # color style + color = 'linen' # linen, wheat, gray, light # header social icons twitter = 'YOUR_TWITTER_ID' # twitter.com/YOUR_TWITTER_ID diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 997443f..77e80bd 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -15,7 +15,7 @@ theme = "hugo-paper" title = "Paper" [params] - theme = 'linen' + color = 'linen' twitter = 'nanxiaobei' github = 'nanxiaobei' diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 63182d4..14f63a6 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,12 +1,12 @@ -{{ $.Scratch.Delete "theme_color" }} +{{ $.Scratch.Delete "bg_color" }} {{ $.Scratch.Delete "social_list" }} {{ $.Scratch.Delete "avatar_url" }} - -{{ $theme_map := dict "gray" "#fbfbfb" "light" "#fff" "linen" "#faf6f1" "wheat" "#f1efe1" }} -{{ $.Scratch.Set "theme_color" (index $theme_map (site.Params.theme | default (print "gray"))) }} + +{{ $color_map := dict "linen" "#faf6f1" "wheat" "#f1efe1" "gray" "#fbfbfb" "light" "#fff" }} +{{ $.Scratch.Set "bg_color" (index $color_map (site.Params.color | default (print "linen"))) }} {{ $social_params := slice "twitter" "github" "instagram" "rss" }} @@ -29,7 +29,7 @@ {{ partial "head.html" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 73fdc1e..32c5638 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -12,7 +12,7 @@ class="btn-menu relative z-50 -mr-8 flex h-[5rem] w-[5rem] shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden" > - {{ $theme_color := $.Scratch.Get "theme_color" }} + {{ $bg_color := $.Scratch.Get "bg_color" }}