refactor: change config.toml structure
This commit is contained in:
parent
292e96d764
commit
47fb5af201
@ -10,11 +10,13 @@ title = "Example Site"
|
||||
|
||||
[params]
|
||||
postSection = "post"
|
||||
favicon = ""
|
||||
[params.sidebar]
|
||||
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.article]
|
||||
defaultLicense = "Licenced under CC BY-NC-SA 4.0"
|
||||
[params.widgets]
|
||||
enabled = ['archive', 'tag-cloud']
|
||||
[params.widgets.archive]
|
||||
|
@ -7,10 +7,10 @@
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.postLicense }}
|
||||
{{ if .Site.Params.article.defaultLicense }}
|
||||
<section class="article-copyright">
|
||||
{{ (resources.Get "icons/copyright.svg").Content | safeHTML }}
|
||||
<span>{{ .Site.Params.postLicense }}</span>
|
||||
<span>{{ .Site.Params.article.defaultLicense }}</span>
|
||||
</section>
|
||||
{{ end }}
|
||||
</footer>
|
@ -6,17 +6,23 @@
|
||||
</button>
|
||||
|
||||
<header class="site-info">
|
||||
{{ if .Site.Params.avatar }}
|
||||
{{ with .Site.Params.sidebar.avatar }}
|
||||
<figure class="site-avatar">
|
||||
{{ $avatar := resources.Get (.Site.Params.avatar) }}
|
||||
{{ $avatar := resources.Get (.) }}
|
||||
|
||||
{{ if $avatar }}
|
||||
{{ $avatarResized := $avatar.Resize "300x300" }}
|
||||
<img src="{{ $avatarResized.RelPermalink }}" width="{{ $avatarResized.Width }}"
|
||||
height="{{ $avatarResized.Height }}" class="site-logo" loading="lazy" alt="Avatar">
|
||||
<span class="emoji">{{ .Site.Params.emoji }}</span>
|
||||
{{ else }}
|
||||
{{ errorf "Failed loading avatar from %q" . }}
|
||||
{{ end }}
|
||||
|
||||
<span class="emoji">{{ $.Site.Params.sidebar.emoji }}</span>
|
||||
</figure>
|
||||
{{ end }}
|
||||
<h1 class="site-name"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
||||
<h2 class="site-description">{{ .Site.Params.subtitle }}</h2>
|
||||
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
|
||||
</header>
|
||||
|
||||
<nav class="menu" id="main-menu">
|
||||
|
Loading…
Reference in New Issue
Block a user