Add a best_game shortcode
This commit is contained in:
parent
8fb0e09e1b
commit
777a10c734
4 changed files with 41 additions and 9 deletions
8
layouts/shortcodes/nethack/best_game.html
Normal file
8
layouts/shortcodes/nethack/best_game.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ $nethack_data := $.Site.Data.nethack.logfile }}
|
||||
{{ $logfile := slice }}
|
||||
{{ range $nethack_data }}
|
||||
{{ $logfile = $logfile | append .logfile }}
|
||||
{{ end }}
|
||||
<div class="logentry">
|
||||
{{ partial "nethack/logentry.html" (index (sort $logfile "score" "desc") 0) }}
|
||||
</div>
|
|
@ -4,7 +4,7 @@
|
|||
{{ $logfile = $logfile | append .logfile }}
|
||||
{{ end }}
|
||||
<ol class="logfile">
|
||||
{{ range sort $logfile "end_date" "desc" }}
|
||||
{{ range first 10 (sort $logfile "end_date" "desc") }}
|
||||
{{ if ne .death.cause "quit" }}
|
||||
<li class="logentry">
|
||||
{{ partial "nethack/logentry.html" .}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue