Update Nethack partials, shortcodes, and page to properly handle ascensions 😁

This commit is contained in:
Eryn Wells 2023-01-24 08:53:58 -08:00
parent d1df92aa03
commit 42a71c1ac3
7 changed files with 59 additions and 36 deletions

View file

@ -0,0 +1,3 @@
{{- $logfile := partial "nethack/log.html" . -}}
{{- $numberOfAscensions := where $logfile "death.cause" "ascended" | len -}}
{{- $numberOfAscensions | lang.FormatNumber 0 -}}

View file

@ -1,8 +1,4 @@
{{ $nethack_data := $.Site.Data.nethack.logfile }}
{{ $logfile := slice }}
{{ range $nethack_data }}
{{ $logfile = $logfile | append .logfile }}
{{ end }}
{{- $logfile := partial "nethack/log.html" . -}}
<ol class="logfile">
{{ range sort $logfile "end_date" "desc" }}
{{ if ne .death.cause "quit" }}

View file

@ -0,0 +1,2 @@
{{- $numberOfEntries := (partial "nethack/log.html" .) | len -}}
{{- $numberOfEntries | lang.FormatNumber 0 -}}

View file

@ -0,0 +1,7 @@
{{- $n := .Get 0 -}}
{{- $logfile := partial "nethack/log.html" . -}}
<ol class="logfile topn">
{{ range first $n (sort $logfile "score" "desc") -}}
<li>{{ partial "nethack/logentry.html" . }}</li>
{{- end }}
</ol>