Move the nethack templates into nethack/ subdirectories of partial and shortcodes

This commit is contained in:
Eryn Wells 2022-04-17 10:12:34 -07:00
parent d1dfea9f97
commit 7f470262ec
4 changed files with 28 additions and 36 deletions

View file

@ -1,12 +0,0 @@
{{ define "main" }}
<article class="post-single">
<header>
<div class="post-title">
<h1>{{ .Title }}</h1>
</div>
</header>
<section class="post-content">
{{ .Content }}
</section>
</article>
{{ end }}

View file

@ -0,0 +1,18 @@
{{ $level := (cond (gt .dungeon.level.n 0) (.dungeon.level.descriptive | lower) .dungeon.level.descriptive) }}
<div>{{ if .death.cause }}🪦{{ end }}</div>
<h4 class="date">{{ time.Format "January 2, 2006" .end_date }}</h4>
<div class="character-descriptor">{{ .character.abbreviated }}</div>
<p>{{ .character.name }}, a {{ .character.alignment.descriptive | lower }} {{ .character.race.descriptive | lower }}
{{ .character.gender.descriptive | lower }} {{ .character.role.descriptive }},
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 }}.</p>
<table class="stats">
<tr>
<td class="began">Began {{ time.Format "January 2, 2006" .start_date }}</td>
<td class="score">{{ .score }} points</td>
<td class="level">Level {{ .character.max_level }}</td>
<td class="hp">{{ cond (gt .character.hp.n 0) (printf "%s / %s" .character.hp.n .character.hp.max)
.character.hp.max }} hp</td>
</tr>
</table>

View file

@ -0,0 +1,10 @@
{{ $nethack_logfile := $.Site.Data.nethack.logfile.nutmeg }}
<ol class="logfile">
{{ range sort $nethack_logfile "end_date" "desc" }}
{{ if ne .death.cause "quit" }}
<li class="logentry">
{{ partial "nethack/logentry.html" .}}
</li>
{{ end }}
{{ end }}
</ol>

View file

@ -1,24 +0,0 @@
{{ $nethack_logfile := $.Site.Data.nethack.logfile.nutmeg }}
<ol class="logfile">
{{ range sort $nethack_logfile "end_date" "desc" }}
{{ if ne .death.cause "quit" }}
<li class="logentry">
<div>{{ if .death.cause }}🪦{{ end }}</div>
<h4 class="date">{{ time.Format "January 2, 2006" .end_date }}</h4>
<div class="character-descriptor">{{ .character.abbreviated }}</div>
<p>{{ .character.name }}, a {{ .character.alignment.descriptive | lower }} {{ .character.race.descriptive | lower }} {{ .character.gender.descriptive | lower }} {{ .character.role.descriptive }},
died {{ if gt .death.count 1 }}for the last time{{ end }} in <span class="nobreak">{{ .dungeon.name }}</span>
on <span class="nobreak">{{ cond (gt .dungeon.level.n 0) (.dungeon.level.descriptive | lower) .dungeon.level.descriptive }}</span>.
She was {{ .death.cause }}.</p>
<table class="stats">
<tr>
<td class="began">Began {{ time.Format "January 2, 2006" .start_date }}</td>
<td class="score">{{ .score }} points</td>
<td class="level">Level {{ .character.max_level }}</td>
<td class="hp">{{ cond (gt .character.hp.n 0) (printf "%s / %s" .character.hp.n .character.hp.max) .character.hp.max }} hp</td>
</tr>
</table>
</li>
{{ end }}
{{ end }}
</ol>