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