fix: render games
This commit is contained in:
parent
0d736d2869
commit
a74da74d43
6 changed files with 56 additions and 32 deletions
|
@ -9,11 +9,11 @@
|
|||
itemscope
|
||||
itemprop="citation"
|
||||
itemtype="https://schema.org/{{- $itemType -}}"
|
||||
{{- if $.titleTrans -}}
|
||||
{{- if .titleTrans -}}
|
||||
lang="{{- $.titleLang -}}"
|
||||
title="{{- $.titleTrans -}}"
|
||||
{{- end -}}>
|
||||
{{- default .Title $.title -}}
|
||||
{{- .title -}}
|
||||
</cite>
|
||||
{{- with $pages -}}</a>{{- end -}}
|
||||
|
||||
|
|
7
layouts/partials/games/rows/date_added.html
Normal file
7
layouts/partials/games/rows/date_added.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{- with . -}}
|
||||
{{ with try ( time.Format "Jan 2, 2006" . ) }}
|
||||
{{ .Value }}
|
||||
{{ else }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
1
layouts/partials/games/rows/platforms.html
Normal file
1
layouts/partials/games/rows/platforms.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ . }}
|
7
layouts/partials/games/rows/release-date.html
Normal file
7
layouts/partials/games/rows/release-date.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{- with . -}}
|
||||
{{ with try ( time.Format "Jan 2, 2006" . ) }}
|
||||
{{ .Value }}
|
||||
{{ else }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
1
layouts/partials/games/rows/title.html
Normal file
1
layouts/partials/games/rows/title.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
|
|
@ -1,16 +1,18 @@
|
|||
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
|
||||
{{ range ( sort $.Site.Data.games.current "Date Started" "desc" ) }}
|
||||
<tr>
|
||||
<td>TODO</td>
|
||||
<td>{{ partial "games/rows/date_added.html" .date_added -}}</td>
|
||||
<td>
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
|
||||
</td>
|
||||
<td>{{ .Platforms }}</td>
|
||||
<td>{{ index . "Date Released" }}</td>
|
||||
<td>{{- partial "games/rows/platforms.html" .platform -}}</td>
|
||||
<td>
|
||||
{{- if index . "Date Started" -}}
|
||||
{{- partial "games/rows/release-date.html" .release_date }}
|
||||
</td>
|
||||
<td>
|
||||
{{- with .date_started -}}
|
||||
Since
|
||||
{{ time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
|
||||
{{ time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}
|
||||
|
@ -21,26 +23,28 @@
|
|||
<tr>
|
||||
<td colspan="6"><h3>Diary</h3></td>
|
||||
</tr>
|
||||
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
|
||||
{{ range ( sort ( where $.Site.Data.games.log "date_finished" "!=" "" ) "date_finished" "desc" ) }}
|
||||
<tr>
|
||||
<td>TODO</td>
|
||||
<td>{{ partial "games/rows/date_added.html" .date_added -}}</td>
|
||||
<td>
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
|
||||
</td>
|
||||
<td>{{ .Platforms }}</td>
|
||||
<td>{{ index . "Date Released" }}</td>
|
||||
<td>{{- partial "games/rows/platforms.html" .platform -}}</td>
|
||||
<td>
|
||||
{{- with index . "Level of Completion" }}
|
||||
{{- partial "games/rows/release-date.html" .release_date }}
|
||||
</td>
|
||||
<td>
|
||||
{{- with .level_of_completion }}
|
||||
{{ . }}
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>
|
||||
{{- if index . "Date Started" -}}
|
||||
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
|
||||
{{- with .date_started -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}–{{- if index . "Date Finished" -}}
|
||||
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
|
||||
{{- end -}}–{{- with .date_finished -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}
|
||||
|
@ -50,26 +54,28 @@
|
|||
<tr>
|
||||
<td colspan="6"><h3>Assorted</h3></td>
|
||||
</tr>
|
||||
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "" ) "Title" "asc" ) }}
|
||||
{{ range ( sort ( where $.Site.Data.games.log "date_finished" "" ) "title" "asc" ) }}
|
||||
<tr>
|
||||
<td>TODO</td>
|
||||
<td>{{ partial "games/rows/date_added.html" .date_added -}}</td>
|
||||
<td>
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
|
||||
</td>
|
||||
<td>{{ .Platforms }}</td>
|
||||
<td>{{ index . "Date Released" }}</td>
|
||||
<td>{{- partial "games/rows/platforms.html" .platform -}}</td>
|
||||
<td>
|
||||
{{- with index . "Level of Completion" }}
|
||||
{{- partial "games/rows/release-date.html" .release_date }}
|
||||
</td>
|
||||
<td>
|
||||
{{- with .level_of_completion }}
|
||||
{{ . }}
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>
|
||||
{{- if index . "Date Started" -}}
|
||||
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
|
||||
{{- with .date_started -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}–{{- if index . "Date Finished" -}}
|
||||
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
|
||||
{{- end -}}–{{- with .date_finished -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}
|
||||
|
@ -77,14 +83,16 @@
|
|||
</tr>
|
||||
{{ end }}
|
||||
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
|
||||
{{ range ( sort $.Site.Data.games.wishlist "Title" "asc" ) }}
|
||||
{{ range ( sort $.Site.Data.games.wishlist "title" "asc" ) }}
|
||||
<tr>
|
||||
<td>TODO</td>
|
||||
<td>{{ partial "games/rows/date_added.html" .date_added -}}</td>
|
||||
<td>
|
||||
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
|
||||
</td>
|
||||
<td>{{ .Platforms }}</td>
|
||||
<td>{{ index . "Date Released" }}</td>
|
||||
<td>{{- partial "games/rows/platforms.html" .platform -}}</td>
|
||||
<td>
|
||||
{{- partial "games/rows/release-date.html" .release_date }}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Reference in a new issue