initial commit

This commit is contained in:
Ben Goldsworthy 2025-01-04 21:19:12 +01:00
commit 5c664be9a8
No known key found for this signature in database
55 changed files with 8825 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{{- with .Author -}}
<p class="authors">{{ . }}</p>
{{- else -}}
{{- $authors_names := slice -}}
{{- range .authors -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- range .work.authors -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- if .contributors -}}
{{- range ( where .contributors "role" "like" `[aA]uthor` ) -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- end -}}
<p class="authors">{{ delimit ( uniq $authors_names ) ", " }}</p>
{{- end -}}
{{- if .contributors -}}
{{- $translators_names := slice -}}
{{- range ( where .contributors "role" "like" `[tT]ranslat` ) -}}
{{- $translators_names = $translators_names | append .name -}}
{{- end -}}
{{- with $translators_names -}}
<p class="authors--additional">Translator(s): {{ delimit ( uniq . ) ", " }}</p>
{{- end -}}
{{- end -}}
{{- with ( index . "Additional Authors" ) -}}
<p class="authors--additional">Additional Author(s): {{ . }}</p>
{{- end -}}

View file

@ -0,0 +1,7 @@
<p class="year">{{- .publish_date -}}
{{- if .first_publish_date -}}
{{- if ( ne .first_publish_date .publish_date ) -}}
&nbsp;<span class="year--original">(<abbr title="original publication year">orig.</abbr>&nbsp;{{ .first_publish_date }})</span>
{{- end -}}
{{- end -}}
</p>

View file

@ -0,0 +1,9 @@
{{- with .date_started -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
Unknown
{{- end -}}&ndash;{{- with .date_finished -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
Unknown
{{- end -}}

View file

@ -0,0 +1,23 @@
{{-
$cite_options := ( dict
"c" .c
"g" .g
"section" "books"
"schemaType" "Book"
"title" ( cond ( isset .c "subtitle" ) (
printf "%s: %s" .c.title .c.subtitle
) (
.c.title
)
)
"edition" (
default .c.edition_name .c.Edition
)
)
-}}
{{- if .c.work.original_language -}}
{{- $cite_options = merge $cite_options ( dict "titleLang" .c.work.original_language "titleTrans" .c.work.title ) -}}
{{- end -}}
{{- partial "cite" $cite_options -}}

View file

@ -0,0 +1,112 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.books.current "date_started" "desc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- with .date_started -}}
Since {{ time.Format "Jan 2, 2006" . -}}
{{- else -}}
Unknown
{{- end -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
<tr>
<td colspan=5><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
<tr>
<td colspan=5><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.books.wishlist "Title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>n/a</td>
</tr>
{{ end }}
{{ end }}

View file

@ -0,0 +1,5 @@
<th>Date Added</th>
<th>Title</th>
<th>Author(s)</th>
<th>Publication Date</th>
<th>Dates Read</th>

View file

@ -0,0 +1,21 @@
{{- $itemType := default "CreativeWork" .schemaType -}}
{{- $pages := where ( where .g.Site.Pages "Section" .section ) "title" .title | first 1 -}}
{{- with .c -}}
{{- with $pages -}}{{- range . -}}<a href="{{ .RelPermalink }}">{{- end -}}{{- end -}}
<cite
class="cite{{ with .citeStyle }} cite--{{ . }}{{ end }}"
itemscope
itemprop="citation"
itemtype="https://schema.org/{{- $itemType -}}"
{{- if $.titleTrans -}}
lang="{{- $.titleLang -}}"
title="{{- $.titleTrans -}}"
{{- end -}}>
{{- default .Title $.title -}}
</cite>
{{- with $pages -}}</a>{{- end -}}
{{- with $.edition }}<p class="edition">{{ . }}</p>{{- end -}}
{{- end -}}

View file

@ -0,0 +1,12 @@
{{ "<!--" | safeHTML }}
{{ .Site.Title}} - {{ .Site.Params.tagline }}
Written in {{ now.Format "2006" }} by {{ .Site.Author.name }} <{{ .Site.Author.email }}>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along
with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
{{ "-->" | safeHTML }}

View file

@ -0,0 +1,81 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
<tr>
<td colspan=4><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "date_finished" "!=" "" ) "date_finished" "desc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
<tr>
<td colspan=4><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "date_finished" "" ) "title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.films.wishlist "title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
{{ end }}

View file

@ -0,0 +1,4 @@
<th>Date Added</th>
<th>Title</th>
<th>Release Date</th>
<th>Date Watched</th>

View file

@ -0,0 +1,78 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.games.current "Date Started" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
<td>
{{- if index . "Date Started" -}}
Since {{ time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
Unknown
{{- end -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
<tr>
<td colspan=4><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</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 }}
<tr>
<td colspan=5><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</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 }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.games.wishlist "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
<td>n/a</td>
</tr>
{{ end }}
{{ end }}

View file

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

View file

@ -0,0 +1,20 @@
<header class="site-header">
{{ block "header" . }}
<h1 class="site-header__title" itemprop="name"><a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a></h1>
<p class="site-header__tagline" itemprop="about">Views my own. Discussion ≠ endorsement. Do try this at home.</p>
<p class="site-header__icons">~
<a href="mailto:{{ $.Site.Author.email }}" rel="me">&#128231;</a> ~
<a href="{{ .Site.Params.codeURL }}">&#128187;</a> ~
<a href="/{{ .Site.Params.keyfile }}">&#128272;</a> ~
<a href="/index.xml"><img class="feed-icon" src="/images/feed-icon.svg"></a> ~
</p>
<nav class="site-header__nav">
<ul>
{{ range .Site.Sections.ByTitle }}
<a href="{{ .RelPermalink }}"><li>{{ .Title | safeHTML }}</li></a>
{{ end }}
</ul>
</nav>
{{ end }}
</header>

View file

@ -0,0 +1,22 @@
{{- $series_tmdb_id := .tmdb_id -}}
{{- $series := "" -}}
{{- range ( index .g.Site.Data.tv_series.current ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- range ( index .g.Site.Data.tv_series.log ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- range ( index .g.Site.Data.tv_series.wishlist ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- return $series -}}

View file

@ -0,0 +1,51 @@
{{- $section := default "" ( .Scratch.Get "section" ) -}}
{{- $list_mode := default "" ( .Scratch.Get "listMode" ) -}}
{{- $log_file := index ( index $.Site.Data $section ) $list_mode -}}
{{- if $log_file -}}
{{- $total := len $log_file -}}
{{- $today := time.Now -}}
{{-
$this_year_total := (
where (
where $log_file "date_finished" "gt" (
( $today.AddDate -1 0 0 ).Format "2006-01-02"
)
) "date_finished" "lt" ( $today.Format "2006-01-02" )
) | len
-}}
{{-
$this_quarter_total := (
where (
where $log_file "date_finished" "gt" (
( $today.AddDate 0 -3 0 ).Format "2006-01-02"
)
) "date_finished" "lt" ( $today.Format "2006-01-02" )
) | len
-}}
{{-
$this_month_total := (
where (
where $log_file "date_finished" "gt" (
( $today.AddDate 0 -1 0 ).Format "2006-01-02"
)
) "date_finished" "lt" ( $today.Format "2006-01-02" )
) | len
-}}
<details class="log-stats">
<summary>Summary</summary>
<div>
<p>Total: {{ lang.FormatNumber 0 $total }}</p>
{{- if eq $list_mode "log" -}}
<p>Last 12 months: {{ lang.FormatNumber 0 $this_year_total }}</p>
<p>Last 3 months: {{ lang.FormatNumber 0 $this_quarter_total }}</p>
<p>Last month: {{ lang.FormatNumber 0 $this_month_total }}</p>
{{- end -}}
</div>
</details>
{{- end -}}

View file

@ -0,0 +1,16 @@
{{ if ( .Scratch.Get "listMode" ) }}
<table>
<thead>
<tr>
{{ if ( and ( in site.Params.mainSections .Section ) ( in "current log wishlist" ( .Scratch.Get "page" ) ) ) }}
{{ partial ( printf "%s/%s" .Section "table-header" ) . }}
{{ end }}
</tr>
</thead>
<tbody>
{{ if ( and ( in site.Params.mainSections .Section ) ( in "current log wishlist" ( .Scratch.Get "page" ) ) ) }}
{{ partial ( printf "%s/%s" .Section "table-body" ) . }}
{{ end }}
</tbody>
<table>
{{ end }}

View file

@ -0,0 +1,46 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "date_finished" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort ( index $.Site.Data.tv_episodes ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
{{- with ( index . "Series Title" ) -}}
<cite class="cite" itemscope itemtype="TVSeries">{{ . }}</cite>
{{- else -}}
{{- $series := partialCached "series_by_id" ( dict "g" $ "tmdb_id" .series.tmdb_id ) .series.tmdb_id -}}
{{- if ( not ( eq $series "" ) ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVSeries" "title" $series.name "titleLang" $series.original_language "titleTrans" $series.original_name ) -}}
{{- else -}}
Unknown series
{{- end -}}
{{- end -}}
</td>
<td>
{{- if ( index . "Episode Title" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVEpisode" "title" ( index . "Episode Title" ) ) -}}
<span class="episode-number">({{ index . "Episode Number" }})</span>
{{- else -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVEpisode" "title" .name ) -}}
<span class="episode-number">(S{{ .season_number }}E{{ .episode_number }})</span>
{{- end -}}
</td>
<td>
{{- if ( or ( index . "Date Watched" ) .date_finished ) -}}
{{- with ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- end -}}
{{- if ( or .is_rewatch .Rewatch ) }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
{{ end }}

View file

@ -0,0 +1,3 @@
<th>Series Title</th>
<th>Episode Title</th>
<th>Watch Date</th>