Skip to content

Commit

Permalink
Workaround .Site.Author deprecation
Browse files Browse the repository at this point in the history
This change needs to be reverted once it is fixed in Mainroad (theme)
See Vimux/Mainroad#379
  • Loading branch information
jonatan-ivanov committed Oct 25, 2024
1 parent f0101b3 commit 6af4408
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions layouts/partials/authorbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Param "authorbox" }}
<div class="authorbox clearfix">
{{- if and (not .Site.Params.Author.avatar) (not .Site.Params.Author.name) (not .Site.Params.Author.bio) }}
<p class="authorbox__warning">
<strong>WARNING:</strong> Authorbox is activated, but [Author] parameters are not specified.
</p>
{{- end }}
{{- with .Site.Params.Author.avatar }}
<figure class="authorbox__avatar">
<img alt="{{ $.Site.Params.Author.name }} avatar" src="{{ $.Site.Params.Author.avatar | relURL }}" class="avatar" height="90" width="90">
</figure>
{{- end }}
{{- with .Site.Params.Author.name }}
<div class="authorbox__header">
<span class="authorbox__name">{{ T "authorbox_name" (dict "Name" .) }}</span>
</div>
{{- end }}
{{- with .Site.Params.Author.bio }}
<div class="authorbox__description">
{{ . | markdownify }}
</div>
{{- end }}
</div>
{{- end }}
6 changes: 6 additions & 0 deletions layouts/partials/post_meta/author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- if .Site.Params.Author.name -}}
<div class="meta__item-author meta__item">
{{ partial "svg/author.svg" (dict "class" "meta__icon") -}}
<span class="meta__text">{{ .Site.Params.Author.name }}</span>
</div>
{{- end -}}

0 comments on commit 6af4408

Please sign in to comment.