list.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{/* Author profile page. */}}
  2. {{- define "main" -}}
  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">
  22. <div class="hr-light"></div>
  23. <h3>{{ i18n "user_profile_latest" | default "Latest" }}</h3>
  24. <ul>
  25. {{ range $query }}
  26. <li>
  27. <a href="{{ .RelPermalink }}">{{ .Title }}</a>
  28. </li>
  29. {{ end }}
  30. </ul>
  31. </div>
  32. {{ end }}
  33. </div>
  34. </section>
  35. {{- end -}}