From 6eabf271ce198baacd4f71a1e0d6b48b05c7edb3 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 6 Mar 2024 14:22:23 +0800 Subject: [PATCH] update icons --- exampleSiteMultilingual/hugo.toml | 2 +- layouts/partials/font-awesome.html | 45 ++++++++- layouts/partials/theme-switcher.html | 144 +++++++++++++-------------- 3 files changed, 114 insertions(+), 77 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 7a5facf..bcc2ce6 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -17,7 +17,7 @@ description = "Anubis2 is another simple minimalist theme for Hugo blog engine." dateFormat = "2006-01-02" paginationSinglePost = true style = "auto" -readMore = true +readMore = false readNextPosts = 2 copyCodeButton = true rssAsSocialIcon = true diff --git a/layouts/partials/font-awesome.html b/layouts/partials/font-awesome.html index 646aa22..3ee0f18 100644 --- a/layouts/partials/font-awesome.html +++ b/layouts/partials/font-awesome.html @@ -2,12 +2,49 @@ {{ $dict := newScratch }} -{{ if (eq .custom true) }} - {{ $dict.Set "svg" (readFile (print "static/fa-icons/" .iconName ".svg")) }} +{{ if (eq .iconName "github") }} + + + + +{{ else if (eq .iconName "theme-dark" )}} + +{{ else if (eq .iconName "theme-light")}} + + + + + + + + + + + + +{{ else if (eq .iconName "docs")}} + + + + + + + + +{{ else if (eq .iconName "rss")}} + + + + + + {{ else }} - {{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }} + {{ if (eq .custom true) }} + {{ $dict.Set "svg" (readFile (print "static/fa-icons/" .iconName ".svg")) }} + {{ else }} + {{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }} + {{ end }} {{ end }} - {{- $path:=" - {{ partial "font-awesome.html" (dict "iconName" "halfcircle" "custom" false) }} - -{{ end }} - - + {{ if ne "auto-without-switcher" $style }} +
+ {{ partial "font-awesome.html" (dict "iconName" "theme-light" "custom" false) }} +
+ {{ end }} + + {{ end }}