~jcc/hugo-site

c4860c8815a0921260cb823f8d69a4cac1371a3c — Jason Cox 2 months ago 71a8bef
Add list of most-read authors

Only show those with at least two books -- the list is way too long
otherwise.
1 files changed, 12 insertions(+), 0 deletions(-)

M layouts/book-authors/terms.html
M layouts/book-authors/terms.html => layouts/book-authors/terms.html +12 -0
@@ 1,4 1,16 @@
{{ define "after-content" }}
<details>
  <summary>Which authors have I read the most?</summary>
  <ol>
{{ range (sort (where .Pages "Pages.Len" "gt" 1) "Pages.Len" "desc") }}
    <li>
      <a href="#{{ .Data.Term }}">{{ .Data.Term }}</a>:
      {{ .Pages.Len }} {{ cond (eq .Pages.Len 1) "book" "books"}}
    </li>
{{ end }}
  </ol>
</details>

{{ range .Pages.ByTitle }}
<details open id="{{ .Data.Term }}">
  <summary>