Skip to content

Commit

Permalink
refactor template
Browse files Browse the repository at this point in the history
  • Loading branch information
onweru committed Nov 17, 2023
1 parent adf4e5e commit ef30578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
13 changes: 7 additions & 6 deletions layouts/partials/authorbox.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{{- if .Param "authorbox" }}
{{ $author := site.Params.author }}
<div class="authorbox clearfix">
{{- if and (not .Site.Author.avatar) (not .Site.Author.name) (not .Site.Author.bio) }}
{{- if and (not $author.avatar) (not $author.name) (not $author.bio) }}
<p class="authorbox__warning">
<strong>WARNING:</strong> Authorbox is activated, but [Author] parameters are not specified.
</p>
{{- end }}
{{- with .Site.Author.avatar }}
{{- with $author.avatar }}
<figure class="authorbox__avatar">
<img alt="{{ $.Site.Author.name }} avatar" src="{{ $.Site.Author.avatar | relURL }}" class="avatar" height="90" width="90">
<img alt="{{ $author.name }} avatar" src="{{ relURL $author.avatar }}" class="avatar" height="90" width="90">
</figure>
{{- end }}
{{- with .Site.Author.name }}
{{- with $author.name }}
<div class="authorbox__header">
<span class="authorbox__name">{{ T "authorbox_name" (dict "Name" .) }}</span>
</div>
{{- end }}
{{- with .Site.Author.bio }}
{{- with $author.bio }}
<div class="authorbox__description">
{{ . | markdownify }}
{{ markdownify . }}
</div>
{{- end }}
</div>
Expand Down
5 changes: 3 additions & 2 deletions layouts/partials/post_meta/author.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Site.Author.name -}}
{{ $author := site.Params.author }}
{{- if $author.name -}}
<div class="meta__item-author meta__item">
{{ partial "svg/author.svg" (dict "class" "meta__icon") -}}
<span class="meta__text">{{ .Site.Author.name }}</span>
<span class="meta__text">{{ $author.name }}</span>
</div>
{{- end -}}

0 comments on commit ef30578

Please sign in to comment.