Skip to content

Commit 6af4408

Browse files
Workaround .Site.Author deprecation
This change needs to be reverted once it is fixed in Mainroad (theme) See Vimux/Mainroad#379
1 parent f0101b3 commit 6af4408

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

layouts/partials/authorbox.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- if .Param "authorbox" }}
2+
<div class="authorbox clearfix">
3+
{{- if and (not .Site.Params.Author.avatar) (not .Site.Params.Author.name) (not .Site.Params.Author.bio) }}
4+
<p class="authorbox__warning">
5+
<strong>WARNING:</strong> Authorbox is activated, but [Author] parameters are not specified.
6+
</p>
7+
{{- end }}
8+
{{- with .Site.Params.Author.avatar }}
9+
<figure class="authorbox__avatar">
10+
<img alt="{{ $.Site.Params.Author.name }} avatar" src="{{ $.Site.Params.Author.avatar | relURL }}" class="avatar" height="90" width="90">
11+
</figure>
12+
{{- end }}
13+
{{- with .Site.Params.Author.name }}
14+
<div class="authorbox__header">
15+
<span class="authorbox__name">{{ T "authorbox_name" (dict "Name" .) }}</span>
16+
</div>
17+
{{- end }}
18+
{{- with .Site.Params.Author.bio }}
19+
<div class="authorbox__description">
20+
{{ . | markdownify }}
21+
</div>
22+
{{- end }}
23+
</div>
24+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{- if .Site.Params.Author.name -}}
2+
<div class="meta__item-author meta__item">
3+
{{ partial "svg/author.svg" (dict "class" "meta__icon") -}}
4+
<span class="meta__text">{{ .Site.Params.Author.name }}</span>
5+
</div>
6+
{{- end -}}

0 commit comments

Comments
 (0)