Files
HugoBlox-kit/layouts/authors/list.html
T
George Cushen 0d8d0d43a1 feat: add support for Hugo v0.63
Hugo v0.63 introduced breaking changes such as breaking templates that don't immediately begin with a `define` (even if the first line is just a code comment): https://gohugo.io/news/0.63.0-relnotes/

Adds compatibility with Hugo v0.63, fixing author pages rendering blank.
2020-01-26 20:29:18 +00:00

40 lines
1.1 KiB
HTML

{{- define "main" -}}
{{/* Author profile page. */}}
{{/* If an account has not been created for this user, just display their name as the title. */}}
{{ if not .File }}
<div class="universal-wrapper pt-3">
<h1>{{ .Title }}</h1>
</div>
{{ end }}
<section id="profile-page" class="pt-5">
<div class="container">
{{/* Show the About widget if an account exists for this user. */}}
{{ if .File }}
{{ $widget := "widgets/about.html" }}
{{ $username := (path.Base (path.Split .Path).Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "root" $ "page" . "author" $username }}
{{ partial $widget $params }}
{{end}}
{{ $query := where .Pages ".IsNode" false }}
{{ $count := len $query }}
{{ if $count }}
<div class="article-widget content-widget-hr">
<h3>{{ i18n "user_profile_latest" | default "Latest" }}</h3>
<ul>
{{ range $query }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</section>
{{- end -}}