{{/* Author profile page. */}}
{{- define "main" -}}
{{/* 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 widget if an account exists for this user. */}}
{{ if .File }}
{{ $widget := "widgets/about.html" }}
{{ $baseExcluded := strings.TrimLeft site.BaseURL .Permalink }}
{{ $username := index (split $baseExcluded "/") 1 }}
{{ $params := dict "root" $ "page" . "author" $username }}
{{ partial $widget $params }}
{{end}}
{{ $query := where .Pages ".IsNode" false }}
{{ $count := len $query }}
{{ if $count }}