update film log template

This commit is contained in:
Ben Goldsworthy 2024-01-08 23:58:53 +01:00
parent 97c32fb09a
commit c427ba9bbe

View file

@ -2,17 +2,17 @@
<tr>
<td colspan=4><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "Date Watched" "!=" "" ) "Date Watched" "desc" ) }}
{{ range ( sort ( where $.Site.Data.films.log "date_watched" "!=" "" ) "date_watched" "desc" ) }}
<tr>
<td>{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "Movie" ) -}}
{{ .title }}
</td>
<td>{{ index . "Release Year" }}</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- if .Rewatch }} &#x21BB;{{ end -}}
{{- if .date_watched -}}
{{- time.Format "Jan 2, 2006" .date_watched -}}
{{- if .is_rewatch }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
@ -22,25 +22,25 @@
<tr>
<td colspan=4><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "Date Watched" "" ) "Title" "asc" ) }}
{{ range ( sort ( where $.Site.Data.films.log "date_watched" "" ) "title" "asc" ) }}
<tr>
<td>{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .Title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
{{ end }}
{{- end -}}
<cite class="film">{{ .title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
</a>
{{- end -}}
{{- end -}}
</td>
<td>{{ index . "Release Year" }}</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- if .Rewatch }} &#x21BB;{{ end -}}
{{- if .date_watched -}}
{{- time.Format "Jan 2, 2006" .date_watched -}}
{{- if .is_rewatch }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
@ -48,25 +48,25 @@
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.films.wishlist "Title" "asc" ) }}
{{ range ( sort $.Site.Data.films.wishlist "title" "asc" ) }}
<tr>
<td>{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .Title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Title ) -}}
<cite class="film">{{ .title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
</a>
{{- end -}}
</td>
<td>{{ index . "Release Year" }}</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- if .Rewatch }} &#x21BB;{{ end -}}
{{- if .date_watched -}}
{{- time.Format "Jan 2, 2006" .date_watched -}}
{{- if .is_rewatch }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}