diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3a61d45..bc0766c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -10,11 +10,13 @@ title = "Example Site" [params] postSection = "post" - emoji = "🍥" - avatar = "img/avatar.png" - subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." - postLicense = "Licenced under CC BY-NC-SA 4.0" favicon = "" + [params.sidebar] + emoji = "🍥" + avatar = "img/avatar.png" + subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + [params.article] + defaultLicense = "Licenced under CC BY-NC-SA 4.0" [params.widgets] enabled = ['archive', 'tag-cloud'] [params.widgets.archive] diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 223710a..39fc8d8 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -7,10 +7,10 @@ {{ end }} - {{ if .Site.Params.postLicense }} + {{ if .Site.Params.article.defaultLicense }}
{{ (resources.Get "icons/copyright.svg").Content | safeHTML }} - {{ .Site.Params.postLicense }} + {{ .Site.Params.article.defaultLicense }}
{{ end }} \ No newline at end of file diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index dacc85b..334fb13 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -6,17 +6,23 @@
- {{ if .Site.Params.avatar }} + {{ with .Site.Params.sidebar.avatar }}
- {{ $avatar := resources.Get (.Site.Params.avatar) }} - {{ $avatarResized := $avatar.Resize "300x300" }} - - {{ .Site.Params.emoji }} + {{ $avatar := resources.Get (.) }} + + {{ if $avatar }} + {{ $avatarResized := $avatar.Resize "300x300" }} + + {{ else }} + {{ errorf "Failed loading avatar from %q" . }} + {{ end }} + + {{ $.Site.Params.sidebar.emoji }}
{{ end }}

{{ .Site.Title }}

-

{{ .Site.Params.subtitle }}

+

{{ .Site.Params.sidebar.subtitle }}