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" . -}} + + + {{ .Site.Title }} +
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a52b2b8..1ebce2b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,30 +1,9 @@ -{{ $Site := .Page.Site }} -{{ $Params := $Site.Params }} - - - - + + + + +{{/**/}} + - - - - - - - - - - - - - - - - {{ $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . -}} - - - - - - {{ $Site.Title }} - \ No newline at end of file + + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index d287d4a..c33921d 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -46,7 +46,7 @@ {{ $cc := .Site.Params.creativeCommons }} {{ if and $cc $cc.sidebar }} diff --git a/static/css/main.css b/static/css/main.css index b6e82d4..218bb54 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1277,8 +1277,6 @@ pre code { border: 1px solid #eee; max-width: 120px; padding: 2px; - border-radius: 50%; - transition: transform 1s ease-out; } .site-author-image:hover { transform: rotateZ(360deg); diff --git a/static/imgs/hugo-next-avator.png b/static/imgs/hugo-next-avatar.png similarity index 100% rename from static/imgs/hugo-next-avator.png rename to static/imgs/hugo-next-avatar.png