Move a bunch of shortcodes and partials back from the platters theme
This commit is contained in:
parent
20d53e0df2
commit
3102dc1e56
29 changed files with 1 additions and 1 deletions
6
layouts/partials/nethack/log.html
Normal file
6
layouts/partials/nethack/log.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{ $nethack_data := $.Site.Data.nethack.logfile }}
|
||||
{{ $logfile := slice }}
|
||||
{{ range $nethack_data }}
|
||||
{{ $logfile = $logfile | append .logfile }}
|
||||
{{ end }}
|
||||
{{ return $logfile }}
|
48
layouts/partials/nethack/logentry.html
Normal file
48
layouts/partials/nethack/logentry.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
{{- $cause := .death.cause -}}
|
||||
{{- $didAscend := eq $cause "ascended" -}}
|
||||
{{- $level := (cond (gt .dungeon.level.n 0) (.dungeon.level.descriptive | lower) .dungeon.level.descriptive) -}}
|
||||
<div>{{- if $didAscend -}}✨{{- else -}}🪦{{- end -}}</div>
|
||||
<h4 class="date">{{ time.Format "January 2, 2006" .end_date }}</h4>
|
||||
<div class="character-descriptor">{{ .character.abbreviated }}</div>
|
||||
<p>
|
||||
{{- $name := .character.name -}}
|
||||
{{- $descriptiveAlignment := .character.alignment.descriptive | lower -}}
|
||||
{{- $descriptiveRace := .character.race.descriptive | lower -}}
|
||||
{{- $descriptiveRole := .character.role.descriptive -}}
|
||||
{{- if $didAscend -}}
|
||||
{{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, ascended.
|
||||
{{- else -}}
|
||||
{{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, died
|
||||
{{ if gt .death.count 1 -}}for the last time{{- end }} in
|
||||
<span class="nobreak">{{ .dungeon.name }}</span>
|
||||
on <span class="nobreak">{{ $level }}</span>.
|
||||
She was {{ .death.cause }}.
|
||||
{{- end -}}
|
||||
</p>
|
||||
<table class="stats">
|
||||
<tr>
|
||||
{{- $startDate := time.Format "January, 02 2006" .start_date -}}
|
||||
{{- $startDatetime := time.Format "2006-01-02" .start_date -}}
|
||||
<td class="began">Began <time class="nobreak" datetime="{{ $startDatetime }}">{{ $startDate }}</time></td>
|
||||
<td class="score">{{ .score | lang.FormatNumber 0 }} points</td>
|
||||
{{/*
|
||||
When I first wrote the importer script, I read about the log file
|
||||
format on the Nethackwiki. It labeled a field as "maximum level",
|
||||
which I interpreted as maximum character level. Turns out it's
|
||||
actually maximum *dungeon* level. The script has been updated, but I
|
||||
won't be able to update all the imported logfiles.
|
||||
|
||||
https://nethackwiki.com/wiki/Logfile
|
||||
*/}}
|
||||
{{ with .dungeon.max_level }}
|
||||
<td class="level">{{ .descriptive }}</td>
|
||||
{{ else }}
|
||||
{{ with .character.max_level }}<td class="level">Level {{ . }}</td>{{ end }}
|
||||
{{ end }}
|
||||
<td class="hp">
|
||||
{{- $hp := float .character.hp.n -}}
|
||||
{{- $hpMax := .character.hp.max -}}
|
||||
{{- if gt $hp 0 }}{{ $hp }} / {{ $hpMax }}{{ else }}{{ $hp }}{{ end }} hp
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue