list.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {{- define "main" -}}
  2. {{/* Author profile page. */}}
  3. {{/* If an account has not been created for this user, just display their name as the title. */}}
  4. {{ if not .File }}
  5. <div class="universal-wrapper pt-3">
  6. <h1>{{ .Title }}</h1>
  7. </div>
  8. {{ end }}
  9. <section id="profile-page" class="pt-5">
  10. <div class="container">
  11. {{/* Show the About widget if an account exists for this user. */}}
  12. {{ if .File }}
  13. {{ $widget := "widgets/about.html" }}
  14. {{ $username := (path.Base (path.Split .Path).Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
  15. {{ $params := dict "root" $ "page" . "author" $username }}
  16. {{ partial $widget $params }}
  17. {{end}}
  18. {{ $query := where .Pages ".IsNode" false }}
  19. {{ $count := len $query }}
  20. {{ if $count }}
  21. <div class="article-widget content-widget-hr">
  22. <h3>{{ i18n "user_profile_latest" | default "Latest" }}</h3>
  23. <ul>
  24. {{ range $query }}
  25. <li>
  26. <a href="{{ .RelPermalink }}">{{ .Title }}</a>
  27. </li>
  28. {{ end }}
  29. </ul>
  30. </div>
  31. {{ end }}
  32. </div>
  33. </section>
  34. {{- end -}}