initial commit
This commit is contained in:
commit
5c664be9a8
55 changed files with 8825 additions and 0 deletions
53
layouts/_default/baseof.html
Normal file
53
layouts/_default/baseof.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
{{ partialCached "copying.html" . }}
|
||||
|
||||
<html itemscope itemtype="https://schema.org/WebSite">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, intitial-scale=1">
|
||||
<meta name="robots" content="noindex">
|
||||
<!--<meta http-equiv="Content-Security-Policy" content="default-src 'self'">-->
|
||||
<meta name="theme-color" content="#FFFFF0">
|
||||
<meta name="description" content="{{ block "head-description" . }}{{ $.Site.Params.description | html }}{{ end }}">
|
||||
<meta name="twitter:dnt" content="on">
|
||||
|
||||
<title itemprop="name">{{- block "title" . -}}{{- .Site.Title }} | {{ .Site.Params.tagline -}}{{- end -}}</title>
|
||||
|
||||
<link rel="license" href="{{ block "head-license" . }}https://creativecommons.org/publicdomain/zero/1.0/{{ end }}">
|
||||
<link rel="me" href="mailto:me+bg@bengoldsworthy.net">
|
||||
<link rel="icon" sizes="192x192" href="/images/icon.png">
|
||||
{{ with .OutputFormats.Get "rss" }}<link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .RelPermalink }}" title="{{ $.Site.Title | safeHTML }}" />{{ end }}
|
||||
|
||||
<link href="/css/sanitize.css" rel="stylesheet" />
|
||||
{{- $sass := resources.Get "css/main.scss" }}
|
||||
{{- $style := $sass | css.Sass | resources.Fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity | html }}">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="site-container site-container{{ block "main-class" . }}{{ end }}">
|
||||
{{ block "header" . -}}
|
||||
{{- partialCached "header/site-header.html" . -}}
|
||||
{{- end }}
|
||||
|
||||
<main class="site-content site-content{{ block "main-class" . }}{{ end }}" itemscope itemtype="{{ block "main-type" . }}https://schema.org/Thing{{ end }}">
|
||||
{{ block "main-header" . }}{{ end }}
|
||||
{{ block "main-body" . }}{{ end }}
|
||||
{{ block "main-footer" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
{{- block "footer" . -}}
|
||||
<footer class="site-footer">
|
||||
<p>
|
||||
By <a href="/">{{ $.Site.Author.name }}</a> |
|
||||
<a href="{{ $.Site.Params.codeURL }}{{ $.Site.Params.reportIssueURL }}" target="_blank" rel="noopener noreferrer">Report an Issue</a> |
|
||||
<a href="{{ relref . "privacy-policy" }}">Privacy Policy</a> |
|
||||
<a href="/{{ .Sitemap.Filename }}">Sitemap</a> |
|
||||
Built: {{ now.Format "2006-01-02T15:04:05" }}
|
||||
</p>
|
||||
</footer>
|
||||
{{- end -}}
|
||||
</body>
|
||||
|
||||
</html>
|
37
layouts/_default/list.html
Normal file
37
layouts/_default/list.html
Normal file
|
@ -0,0 +1,37 @@
|
|||
{{ define "title" }}
|
||||
{{ .Page.Title | plainify }} | {{ .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-class" }}--list{{ end }}
|
||||
|
||||
{{ define "main-type" }}.{{ .Params.mainType }}{{ end }}
|
||||
{{ define "item-type" }}{{ .Params.itemsType }}{{ end }}
|
||||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
<h1 class="page-title">{{ .Title | safeHTML }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img class="feed-icon" src="/images/feed-icon.svg">
|
||||
</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<main class="site-content__body">
|
||||
{{ if .File }}
|
||||
{{ if ( eq .File.Dir "log/" ) }}
|
||||
{{ .Scratch.Set "listMode" "log" }}
|
||||
{{ else if ( eq .File.Dir "wishlist/" ) }}
|
||||
{{ .Scratch.Set "listMode" "wishlist" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if ( in "log/ wishlist/" .File.Dir ) }}
|
||||
{{ partial "table" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ end }}
|
56
layouts/_default/section.html
Normal file
56
layouts/_default/section.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
{{ define "title" }}
|
||||
{{ .Page.Title | plainify }} | {{ .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-class" }}--section{{ end }}
|
||||
|
||||
{{ define "main-type" }}.{{ .Params.mainType }}{{ end }}
|
||||
{{ define "item-type" }}{{ .Params.itemsType }}{{ end }}
|
||||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
{{- .Scratch.Set "section" ( first 1 ( split .File.Dir "/" ) ) -}}
|
||||
{{- $section := .Scratch.Get "section" -}}
|
||||
{{ if ( or ( in "books" ( delimit $section "" ) ) ( in "games" ( delimit $section "" ) ) ) }}
|
||||
<a href="/{{ delimit $section "" }}/current">Current</a> ~
|
||||
{{ end }}
|
||||
<a href="/{{ delimit $section "" }}/log">Log</a> ~
|
||||
<a href="/{{ delimit $section "" }}/wishlist">Wishlist</a>
|
||||
|
||||
<h1 class="page-title">{{ .Title | safeHTML }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img class="feed-icon" src="/images/feed-icon.svg">
|
||||
</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<main class="site-content__body">
|
||||
{{ if .File }}
|
||||
|
||||
{{ .Scratch.Set "page" ( index ( split .File.Dir "/" ) 1 ) }}
|
||||
{{ if ( in "current log wishlist" ( .Scratch.Get "page" ) ) }}
|
||||
|
||||
{{ if ( eq ( .Scratch.Get "page" ) "current" ) }}
|
||||
{{ .Scratch.Set "listMode" "current" }}
|
||||
|
||||
{{ else if ( eq ( .Scratch.Get "page" ) "log" ) }}
|
||||
{{ .Scratch.Set "listMode" "log" }}
|
||||
|
||||
{{ else if ( eq ( .Scratch.Get "page" ) "wishlist" ) }}
|
||||
{{ .Scratch.Set "listMode" "wishlist" }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ partial "stats" . }}
|
||||
|
||||
{{ partial "table" . }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</main>
|
||||
{{ end }}
|
76
layouts/_default/single.html
Normal file
76
layouts/_default/single.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
{{ define "title" }}{{ .Title | plainify }} | {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "head-description" }}{{ .Summary | plainify }}{{ end }}
|
||||
|
||||
{{ define "main-class" }}--single{{ end }}
|
||||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
<div class="article-header__featured-image"
|
||||
{{ if .Params.featured_image }}
|
||||
{{ if .Resources.GetMatch .Params.featured_image }}
|
||||
style="background-image: url({{ ( .Resources.GetMatch .Params.featured_image ).RelPermalink }})"
|
||||
{{ else }}
|
||||
style="background-image: url({{ .Params.featured_image }})"
|
||||
{{ end }}
|
||||
{{ end }}>
|
||||
<div class="article-header__title-wrapper">
|
||||
<h1 class="article-header__title{{ if gt ( len ( .Title | plainify ) ) 40 }} article-header__title--long{{ end }}">
|
||||
<span role="text" itemprop="name">{{ .Title | safeHTML }}</span>
|
||||
</h1>
|
||||
{{ with .Params.subtitle }}
|
||||
<p class="article-header__subtitle">{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ with .Resources.GetMatch .Params.featured_image }}
|
||||
<p class="attr">
|
||||
{{ if .Params.attrlink }}<a href="{{ .Params.attrlink }}" target="_blank" rel="noopener">{{ end }}
|
||||
{{- .Params.Attr | safeHTML -}}
|
||||
{{ if .Params.attrlink }}</a>{{ end }}
|
||||
{{ if .Params.attrlicence }} ({{ .Params.attrlicence }}){{ end }}
|
||||
<p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<p class="article-header__word-count">~<span itemprop="wordCount">{{ .FuzzyWordCount | lang.FormatNumberCustom 0 }}</span> words</p>
|
||||
<p class="article-header__publish-date">Published: <span itemprop="datePublished" datetime="{{ .PublishDate }}">{{ .PublishDate.Format "January 2" }}<sup>{{ if in (slice 1 21 31) .PublishDate.Day}}st{{ else if in (slice 2 22) .PublishDate.Day}}nd{{ else if in (slice 3 23) .PublishDate.Day}}rd{{ else }}th{{ end }}</sup>, 1{{ .PublishDate.Format "2006" | lang.FormatNumberCustom 0 }} <abbr style="text-transform: small-caps; font-size: 0.8em;" title="Holocene Era">HE</abbr></span></p>
|
||||
<p class="article-header__modified-date">Last modified: <span itemprop="dateModified" datetime="{{ .Lastmod }}">{{ .Lastmod.Format "January 2" }}<sup>{{ if in (slice 1 21 31) .Lastmod.Day}}st{{ else if in (slice 2 22) .Lastmod.Day}}nd{{ else if in (slice 3 23) .Lastmod.Day}}rd{{ else }}th{{ end }}</sup>, 1{{ .Lastmod.Format "2006" | lang.FormatNumberCustom 0 }} <abbr style="text-transform: small-caps; font-size: 0.8em;" title="Holocene Era">HE</abbr></span></p>
|
||||
|
||||
{{ $post_age_in_years := math.Round ( div ( div ( now.Sub .PublishDate ).Hours 24 ) 365 ) }}
|
||||
{{ if ( or .Params.site .Params.controversial ( gt $post_age_in_years 2 ) ) }}
|
||||
<aside class="article-header__warnings">
|
||||
<ul>
|
||||
{{ if ( gt $post_age_in_years 2 ) }}<li>This piece was written <strong>over {{ $post_age_in_years }} years ago</strong>. It may no longer accurately reflect my views now, or may be factually outdated.</li>{{ end }}
|
||||
{{ if .Params.controversial }}<li>This piece has been marked as potentially <strong>controversial</strong>, whether due to the topic addressed, the content of the article, or both. Don't say you weren't warned.</li>{{ end }}
|
||||
{{ if .Params.site }}<li>This piece was originally written for an older version of this site. As such, it may not have transferred over properly and some images and links might be broken.</li>{{ end }}
|
||||
</ul>
|
||||
</aside>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.notes }}
|
||||
<aside class="article-header__notes">
|
||||
<ul>
|
||||
{{ range .Params.notes }}
|
||||
<li>{{ . | safeHTML }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</aside>
|
||||
{{ end }}
|
||||
|
||||
{{ if and ( .TableOfContents ) ( ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" ) }}
|
||||
<nav class="article-header__table-of-contents">
|
||||
<h2 class="article-header__subtitle">Table of Contents</h2>
|
||||
{{ .TableOfContents }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<article class="site-content__body">
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-footer" }}
|
||||
{{ end }}
|
11
layouts/index.html
Normal file
11
layouts/index.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{ define "main-class" }}--homepage{{ end }}
|
||||
|
||||
{{ define "header" }} <!-- null --> {{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<h1 class="page-title">
|
||||
Ben's Catalogue
|
||||
</h1>
|
||||
|
||||
{{ range ( where .Pages "Type" "in" site.Params.mainSections ).ByTitle }}<a href="{{ .RelPermalink }}"><h2>{{ .Title }}</h2></a>{{ end }}
|
||||
{{ end }}
|
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>
|
21
layouts/partials/cite.html
Normal file
21
layouts/partials/cite.html
Normal 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 -}}
|
12
layouts/partials/copying.html
Normal file
12
layouts/partials/copying.html
Normal 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 }}
|
81
layouts/partials/films/table-body.html
Normal file
81
layouts/partials/films/table-body.html
Normal 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 }} ↻{{ 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 }} ↻{{ 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 }} ↻{{ end -}}
|
||||
{{- else -}}
|
||||
n/a
|
||||
{{- end -}}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{ end }}
|
4
layouts/partials/films/table-header.html
Normal file
4
layouts/partials/films/table-header.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<th>Date Added</th>
|
||||
<th>Title</th>
|
||||
<th>Release Date</th>
|
||||
<th>Date Watched</th>
|
78
layouts/partials/games/table-body.html
Normal file
78
layouts/partials/games/table-body.html
Normal 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 -}}–{{- 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 -}}–{{- 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 }}
|
4
layouts/partials/games/table-header.html
Normal file
4
layouts/partials/games/table-header.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<th>Title</th>
|
||||
<th>Release Year</th>
|
||||
<th>Platform(s) Played</th>
|
||||
<th>Date Played</th>
|
20
layouts/partials/header/site-header.html
Normal file
20
layouts/partials/header/site-header.html
Normal 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">📧</a> ~
|
||||
<a href="{{ .Site.Params.codeURL }}">💻</a> ~
|
||||
<a href="/{{ .Site.Params.keyfile }}">🔐</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>
|
22
layouts/partials/series_by_id.html
Normal file
22
layouts/partials/series_by_id.html
Normal 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 -}}
|
51
layouts/partials/stats.html
Normal file
51
layouts/partials/stats.html
Normal 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 -}}
|
16
layouts/partials/table.html
Normal file
16
layouts/partials/table.html
Normal 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 }}
|
46
layouts/partials/tv/table-body.html
Normal file
46
layouts/partials/tv/table-body.html
Normal 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 ) }} ↻{{ end -}}
|
||||
{{- else -}}
|
||||
n/a
|
||||
{{- end -}}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{ end }}
|
3
layouts/partials/tv/table-header.html
Normal file
3
layouts/partials/tv/table-header.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<th>Series Title</th>
|
||||
<th>Episode Title</th>
|
||||
<th>Watch Date</th>
|
Loading…
Add table
Add a link
Reference in a new issue