Update templates

This commit is contained in:
Ben Goldsworthy 2023-02-17 19:13:50 -05:00
parent 24bc1422e2
commit bcb942c669
8 changed files with 70 additions and 44 deletions

View file

@ -140,7 +140,9 @@ cite.article--shortcite::after {
content: none;
}
.episode-number {
.episode-number,
.authors--addtional,
.year--original {
font-size: 0.75em;
opacity: 0.8;
}

View file

@ -1,8 +1,8 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ .Scratch.Set "filterCol" "Started At" }}
{{ .Scratch.Set "filterCol" "Date Started" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Finished At" }}
{{ .Scratch.Set "filterCol" "Date Finished" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ .Scratch.Set "filterCol" "Title" }}
@ -11,25 +11,41 @@
{{ range ( sort ( sort ( index $.Site.Data.books ( .Scratch.Get "listMode" ) ) "Title" "asc" ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>{{ index . "Date Added" }}</td>
<td>{{ if index . "Date Added" }}{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}{{ else }}n/a{{end }}</td>
<td>
<p>
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .Title }}</cite>
<cite class="book">{{ .Title }}</cite>{{ if .Edition }} <span class="book--edition">({{ .Edition }})</span>{{ end }}
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
</a>
{{- end -}}
</p>
</td>
<td>{{ .Author }}</td>
<td>{{ index . "Year Published" }}</td>
<td>
{{- if ( index . "Finished At" ) -}}
{{- index . "Finshed At" -}}
<p class="author">{{ .Author }}</p>
{{- if ( index . "Additional Authors" ) -}}
<p class="author--additional">Additional: {{ index . "Additional Authors" }}</p>
{{- end -}}
</td>
<td>
<p class="year">{{- index . "Year Published" -}}
{{- if ( index . "Original Publication Year" ) -}}
<span class="year--original">(orig.&nbsp;{{ index . "Orginal Publication Year" }})</span>
{{- end -}}
</td>
<td>
{{- if index . "Date Started" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
n/a
Unknown
{{- end -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- else -}}
Unknown
{{- end -}}
</td>
</tr>

View file

@ -2,4 +2,4 @@
<th>Title</th>
<th>Author(s)</th>
<th>Publication Date</th>
<th>Read Date</th>
<th>Dates Read</th>

View file

@ -1,35 +1,29 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Watched Date" }}
{{ .Scratch.Set "filterCol" "Date Watched" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ else }}
{{ .Scratch.Set "filterCol" "Name" }}
{{ .Scratch.Set "filterCol" "Title" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ end }}
{{ range ( sort ( sort ( index $.Site.Data.films ( .Scratch.Get "listMode" ) ) "Name" "asc" ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
{{ range ( sort ( sort ( index $.Site.Data.films ( .Scratch.Get "listMode" ) ) "Title" "asc" ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>{{ .Date }}</td>
<td>{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Name ) -}}
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .Name }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Name ) -}}
<cite class="film">{{ .Title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
</a>
{{- end -}}
</td>
<td>{{ .Year }}</td>
<td>{{ index . "Release Year" }}</td>
<td>
{{- if ( index . "Watched Date" ) -}}
{{- index . "Watched Date" -}}
{{- else -}}
n/a
{{- end -}}
</td>
<td>
{{- if ( index . "Watched Date" ) -}}
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- if .Rewatch }} &#x21BB;{{ end -}}
{{- else -}}
n/a

View file

@ -1,5 +1,4 @@
<th>Date Added</th>
<th>Title</th>
<th>Year</th>
<th>Watch Date</th>
<th>Rewatch?</th>
<th>Release Year</th>
<th>Date Watched</th>

View file

@ -1,27 +1,40 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ .Scratch.Set "filterCol" "name" }}
{{ .Scratch.Set "filterCol" "Title" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "name" }}
{{ .Scratch.Set "filterCol" "Title" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ .Scratch.Set "filterCol" "name" }}
{{ .Scratch.Set "filterCol" "Title" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ end }}
{{ range ( sort ( index $.Site.Data.games ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
{{- with ( where ( where $.Site.Pages "Section" "games" ) "Title" .Name ) -}}
{{- with ( where ( where $.Site.Pages "Section" "games" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="game">{{ .name }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "games" ) "Title" .Name ) -}}
<cite class="game">{{ .Title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "games" ) "Title" .Title ) -}}
</a>
{{- end -}}
</td>
<td>{{ .release_date }}</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
<td>
{{- if index . "Date Started" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
Unknown
{{- end -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- else -}}
Unknown
{{- end -}}
{{- if index . "Level of Completion" }} <span class="games__level-of-completion">({{ index . "Level of Completion" }})</span>{{- end -}}
</td>
</tr>
{{ end }}

View file

@ -1,2 +1,4 @@
<th>Title</th>
<th>Release Date</th>
<th>Release Year</th>
<th>Platform(s) Played</th>
<th>Date Played</th>

View file

@ -1,6 +1,6 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Watch Date" }}
{{ .Scratch.Set "filterCol" "Date Watched" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
@ -22,8 +22,8 @@
{{- end -}}
</td>
<td>
{{- if ( index . "Watch Date" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Watch Date" ) -}}
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- else -}}
n/a
{{- end -}}