Compare commits

...

2 commits

Author SHA1 Message Date
a74da74d43
fix: render games 2025-02-21 18:44:27 +01:00
0d736d2869
build(npm): update theme on build 2025-02-21 18:44:19 +01:00
7 changed files with 60 additions and 35 deletions

View file

@ -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 -}}

View file

@ -0,0 +1,7 @@
{{- with . -}}
{{ with try ( time.Format "Jan 2, 2006" . ) }}
{{ .Value }}
{{ else }}
{{ . }}
{{ end }}
{{- end -}}

View file

@ -0,0 +1 @@
{{ . }}

View file

@ -0,0 +1,7 @@
{{- with . -}}
{{ with try ( time.Format "Jan 2, 2006" . ) }}
{{ .Value }}
{{ else }}
{{ . }}
{{ end }}
{{- end -}}

View file

@ -0,0 +1 @@
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}

View file

@ -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 -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- end -}}&ndash;{{- 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 -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- end -}}&ndash;{{- 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 }}

View file

@ -4,9 +4,10 @@
"description": "A media cataloguing site, made with Hugo.",
"scripts": {
"precommit": "npm run lint-staged",
"dev": "hugo mod get -u && hugo server",
"build": "hugo mod get -u && rm -rf ./public/ && hugo --environment production",
"build:dev": "hugo mod get -u && rm -rf ./public_dev/ && hugo --environment staging",
"update:theme": "hugo mod get -u code.bengoldsworthy.net/Rumperuu/Cataloguer@main",
"dev": "npm run update:theme && hugo server",
"build": "npm run update:theme && rm -rf ./public/ && hugo --environment production",
"build:dev": "npm run update:theme && rm -rf ./public_dev/ && hugo --environment staging",
"spellcheck": "cspell \"content/**/*.md\"",
"lint": "npm run lint:js; npm run lint:css; npm run lint:md; npm run lint:html; npm run lint:json",
"lint:fix": "npm run lint:js:fix; npm run lint:css:fix; npm run lint:md:fix; npm run lint:json:fix",