Re-do a bunch of the styles for the Nethack page

This commit is contained in:
Eryn Wells 2022-11-20 12:24:14 -08:00
parent 9e11021ae3
commit 5606feeca1
6 changed files with 38 additions and 28 deletions

View file

@ -2,6 +2,13 @@
{{ partial "single_main.html" . }}
{{ end }}
{{ define "styles" }}
{{- range .Resources.Match "*.css" -}}
{{- $stylesheet := . | fingerprint "md5" }}
<link rel="stylesheet" href="{{ $stylesheet.RelPermalink }}"></script>
{{- end -}}
{{ end }}
{{ define "scripts" }}
{{- if .HasShortcode "figures/railroad" -}}
{{- with partial "resources/railroad_utils.html" . -}}
@ -11,10 +18,10 @@
{{- if .HasShortcode "figures/p5" -}}
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
<script defer src="{{ .Secure.Permalink }}"></script>
<script defer src="{{ .Secure.RelPermalink }}"></script>
{{- end -}}
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
<script defer src="{{ .Secure.Permalink }}"></script>
<script defer src="{{ .Secure.RelPermalink }}"></script>
{{- end -}}
{{- end -}}

View file

@ -9,10 +9,12 @@
She was {{ .death.cause }}.</p>
<table class="stats">
<tr>
<td class="began">Began {{ time.Format "January 2, 2006" .start_date }}</td>
{{- $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>
<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>
</table>

View file

@ -3,6 +3,8 @@
{{ range $nethack_data }}
{{ $logfile = $logfile | append .logfile }}
{{ end }}
<div class="logentry">
<ol class="logfile">
<li>
{{ partial "nethack/logentry.html" (index (sort $logfile "score" "desc") 0) }}
</div>
</li>
</ol>

View file

@ -4,11 +4,11 @@
{{ $logfile = $logfile | append .logfile }}
{{ end }}
<ol class="logfile">
{{ range first 10 (sort $logfile "end_date" "desc") }}
{{ range sort $logfile "end_date" "desc" }}
{{ if ne .death.cause "quit" }}
<li class="logentry">
<li>
{{ partial "nethack/logentry.html" .}}
</li>
{{ end }}
{{ end }}
</ol>
</ol>