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>