initial commit
This commit is contained in:
commit
5c664be9a8
55 changed files with 8825 additions and 0 deletions
34
layouts/partials/books/rows/authors.html
Normal file
34
layouts/partials/books/rows/authors.html
Normal 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 -}}
|
7
layouts/partials/books/rows/publish-date.html
Normal file
7
layouts/partials/books/rows/publish-date.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<p class="year">{{- .publish_date -}}
|
||||
{{- if .first_publish_date -}}
|
||||
{{- if ( ne .first_publish_date .publish_date ) -}}
|
||||
<span class="year--original">(<abbr title="original publication year">orig.</abbr> {{ .first_publish_date }})</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</p>
|
9
layouts/partials/books/rows/read-dates.html
Normal file
9
layouts/partials/books/rows/read-dates.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{- with .date_started -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}–{{- with .date_finished -}}
|
||||
{{- time.Format "Jan 2, 2006" . -}}
|
||||
{{- else -}}
|
||||
Unknown
|
||||
{{- end -}}
|
23
layouts/partials/books/rows/title.html
Normal file
23
layouts/partials/books/rows/title.html
Normal 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 -}}
|
112
layouts/partials/books/table-body.html
Normal file
112
layouts/partials/books/table-body.html
Normal 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 }}
|
5
layouts/partials/books/table-header.html
Normal file
5
layouts/partials/books/table-header.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<th>Date Added</th>
|
||||
<th>Title</th>
|
||||
<th>Author(s)</th>
|
||||
<th>Publication Date</th>
|
||||
<th>Dates Read</th>
|
Loading…
Add table
Add a link
Reference in a new issue