{{- 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 }}
{{ .Title }}
{{ end }}
{{/* Show the About block if an account exists for this user. */}}
{{/* TODO: remove dependency on v1 blocks. Either migrate to v2 blocks(?) or directly implement layout here. */}}
{{ if .File }}
{{ $widget := "blocks/v1/about.html" }}
{{ $username := (path.Base .File.Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "wcPage" $ "wcBlock" . "author" $username }}
{{ partial $widget $params }}
{{end}}
{{ $query := where .Pages ".IsNode" false }}
{{ $count := len $query }}
{{ if $count }}