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 }}
|
Loading…
Add table
Add a link
Reference in a new issue