diff --git a/assets/css/style.css b/assets/css/style.css index ed92d08..6907550 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -1,11 +1,16 @@ /** User-defined style. **/ - +{{- $P := .Site.Params -}} .sidebar { visibility: inherit; } .site-author-image { +{{ if $P.avatar.rounded }} border-radius:50%; +{{ end }} +{{ if $P.avatar.rotated }} + transition: transform 1s ease-out; +{{ end }} } .back-to-top { diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 98ed3eb..23f18e3 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -68,5 +68,12 @@ params: # No setting is required here and can be done by multilanguage # language: deed.zh - + # Sidebar Avatar + avatar: + # Replace the default image and set the url here. + url: /imgs/hugo-next-avatar.png + # If true, the avatar will be displayed in circle. + rounded: true + # If true, the avatar will be rotated with the cursor. + rotated: true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8883759..54e1931 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,8 +1,27 @@ {{ $langCode := replaceRE "-([a-z]+)" (upper (substr .Site.Language -3)) .Site.Language }} +{{ $P := .Site.Params }} +
+ + + - {{ partial "partials/head.html" (dict "Page" . "langCode" $langCode) }} + {{ partial "partials/head.html" . }} + + + + + + + + + + {{- $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . -}} + + +