Move all layouts to platters theme

This commit is contained in:
Eryn Wells 2024-10-07 21:39:17 -07:00
parent de8101efed
commit 66adceaf24
91 changed files with 0 additions and 0 deletions

View file

@ -1,11 +0,0 @@
<title>{{ .Title }}</title>
<id>{{ .Permalink }}</id>
<link href="{{ .Permalink }}" />
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ range slice "series" "categories" "tags" }}
{{- range $.GetTerms . }}
{{- $scheme := (.Site.GetPage (printf "/%s" .Section)).Permalink -}}
<category term="{{ .Name }}" scheme="{{ $scheme }}" label="{{ .Title }}" />
{{ end -}}
{{ end -}}

View file

@ -1,26 +0,0 @@
<header class="content-title">
<h1>{{ .Title | markdownify }}</h1>
{{ with .Description -}}
<p class="subtitle">{{ . }}</p>
{{- end }}
{{ with .Date -}}
<time>{{ . | time.Format "January 2, 2006" }}</time>
{{- end }}
{{- if .Params.series -}}
{{- $series := .GetTerms "series" -}}
{{- if gt (len $series) 1 -}}
{{- errorf "More than one series for %s" .Permalink -}}
{{- end -}}
{{- with index $series 0 -}}
<span class="series">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</span>
{{- end -}}
{{- end -}}
{{ partial "development/draft_tag.html" . }}
</header>

View file

@ -1 +0,0 @@
{{ if .Draft }}<span class="draft">draft</span>{{ end }}

View file

@ -1,22 +0,0 @@
{{ if not hugo.IsProduction }}
<div class="platter" id="debug-page-info">
<details>
<summary>Debug Info</summary>
<h4>Page Details</h4>
<table>
<tbody>
<tr><td>.FirstSection</td><td>{{ .FirstSection }}</td></tr>
<tr><td>.Kind</td><td>{{ .Kind }}</td></tr>
<tr><td>.Permalink</td><td>{{ .Permalink }}</td></tr>
<tr><td>.Section</td><td>{{ .Section }}</td></tr>
<tr><td>.Type</td><td>{{ .Type }}</td></tr>
</tbody>
{{ if eq .Kind "section" }}
<tbody>
<tr><td>len .Pages</td><td>{{ len .Pages }}</td></tr>
</tbody>
{{ end }}
</table>
</details>
</div>
{{ end }}

View file

@ -1,15 +0,0 @@
<details>
<summary>Debug EXIF Data</summary>
<table class="photo-params debug">
<thead>
<td>Key</td>
<td>Value</td>
</thead>
{{ range $k, $v := .Tags }}
<tr>
<td>{{ $k }}</td>
<td>{{ $v }}</td>
</tr>
{{ end }}
</table>
</details>

View file

@ -1,8 +0,0 @@
<footer class="site">
<ul class="slogans">
<li>{{ i18n "transRights" }}</li>
<li>{{ i18n "blackLivesMatter" }}</li>
<li>{{ i18n "getVaccinated" }}</li>
</ul>
<p>Copyright © <time datetime="2020">2020</time><time datetime="{{ now.Year }}">{{ now.Year }}</time> <a href="{{ `` | absURL }}">Eryn Wells</a></p>
</footer>

View file

@ -1,28 +0,0 @@
<div class="taxonomies">
{{- if or .Params.categories .Params.tags -}}
<ul class="tags">
{{- if .Params.categories -}}
{{- $categories := .GetTerms "categories" -}}
{{- if gt (len $categories) 1 -}}
{{- errorf "More than one category for %q" .Path -}}
{{- end -}}
{{- with index (.GetTerms "categories") 0 -}}
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
</ul>
{{- if and .Params.categories .Params.tags -}}
<div class="chevron noselect"></div>
{{- end -}}
<ul class="tags">
{{- if .Params.tags -}}
{{- range .GetTerms "tags" -}}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}
</div>

View file

@ -1,37 +0,0 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ site.Title }}</title>
{{- if eq .Kind "page" -}}
<meta name="description" content="{{ .Summary }}" />
<meta name="author" content="{{ .Params.Author | default site.Author.name }}">
{{ else }}
<meta name="description" content="{{ .Params.description }}">
<meta name="author" content="{{ site.Author.name }}">
{{- end -}}
{{- range $.Scratch.Get "social-list" -}}
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}">
{{- end -}}
<link rel="icon" type="image/png" href="{{ `icons/favicon.png` | relURL }}">
<link rel="apple-touch-icon" type="image/png" href="{{ `icons/touchicon.png` | relURL }}">
<link rel="me" href="https://mastodon.social/@erynofwales">
{{ hugo.Generator }}
{{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .RelPermalink }}" title="{{ site.Title }}">
{{- end -}}
{{- if or hugo.IsProduction (eq site.Params.env "production") -}}
{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{- end -}}
</head>

View file

@ -1,28 +0,0 @@
{{- $currentPage := . -}}
{{- $url := .RelPermalink -}}
<header class="site">
<div class="platter grid">
<h1 class="site gradient">
<a class="site-name" href="{{ `` | absURL }}">{{ partial "site_name.html" site.Params.shortTitle }}</a>
</h1>
{{ partial "site_nav.html" . }}
<nav class="social">
{{ with site.Menus.social }}
{{- range . -}}
{{- $id := .Identifier -}}
{{- $targetBlank := .Params.targetBlank | default true -}}
<li id="social-menu-{{ $id }}">
<a
href="{{ .URL }}"
{{ if $targetBlank }}
target="_blank"
{{ end }}
aria-label="{{ .Name }}">
<img alt="{{ .Name }}" width=20 height=20>
</a>
</li>
{{- end -}}
{{ end }}
</nav>
</div>
</header>

View file

@ -1,30 +0,0 @@
{{ $orientation := 0 }}
{{ with .Params.orientation }}
{{ if strings.Contains . "horizontal" }}
{{ $orientation = 0 }}
{{ else if strings.Contains . "rotate180" }}
{{ $orientation = 180 }}
{{ else if strings.Contains . "rotate90" }}
{{ $orientation = 90 }}
{{ else if strings.Contains . "rotate270" }}
{{ $orientation = 270 }}
{{ end }}
{{ else }}
{{ with (int .Exif.Tags.Orientation) }}
{{/* EXIF orientation is specified as an integer corresponding to a 90º rotation. */}}
{{ if in (slice 1 2) . }}
{{ $orientation = 0 }}
{{ else if in (slice 3 4) . }}
{{ $orientation = 180 }}
{{ else if in (slice 5 6) . }}
{{ $orientation = 90 }}
{{ else if in (slice 7 8) . }}
{{ $orientation = 270 }}
{{ end }}
{{ else }}
{{ warnf "Image missing orientation: %s" . }}
{{ end }}
{{ end }}
{{ return $orientation }}

View file

@ -1,6 +0,0 @@
{{ $nethack_data := $.Site.Data.nethack.logfile }}
{{ $logfile := slice }}
{{ range $nethack_data }}
{{ $logfile = $logfile | append .logfile }}
{{ end }}
{{ return $logfile }}

View file

@ -1,48 +0,0 @@
{{- $cause := .death.cause -}}
{{- $didAscend := eq $cause "ascended" -}}
{{- $level := (cond (gt .dungeon.level.n 0) (.dungeon.level.descriptive | lower) .dungeon.level.descriptive) -}}
<div>{{- if $didAscend -}}✨{{- else -}}🪦{{- end -}}</div>
<h4 class="date">{{ time.Format "January 2, 2006" .end_date }}</h4>
<div class="character-descriptor">{{ .character.abbreviated }}</div>
<p>
{{- $name := .character.name -}}
{{- $descriptiveAlignment := .character.alignment.descriptive | lower -}}
{{- $descriptiveRace := .character.race.descriptive | lower -}}
{{- $descriptiveRole := .character.role.descriptive -}}
{{- if $didAscend -}}
{{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, ascended.
{{- else -}}
{{ $name }}, a {{ $descriptiveAlignment }} {{ $descriptiveRace }} {{ $descriptiveRole }}, died
{{ if gt .death.count 1 -}}for the last time{{- end }} in
<span class="nobreak">{{ .dungeon.name }}</span>
on <span class="nobreak">{{ $level }}</span>.
She was {{ .death.cause }}.
{{- end -}}
</p>
<table class="stats">
<tr>
{{- $startDate := time.Format "January, 02 2006" .start_date -}}
{{- $startDatetime := time.Format "2006-01-02" .start_date -}}
<td class="began">Began <time class="nobreak" datetime="{{ $startDatetime }}">{{ $startDate }}</time></td>
<td class="score">{{ .score | lang.FormatNumber 0 }} points</td>
{{/*
When I first wrote the importer script, I read about the log file
format on the Nethackwiki. It labeled a field as "maximum level",
which I interpreted as maximum character level. Turns out it's
actually maximum *dungeon* level. The script has been updated, but I
won't be able to update all the imported logfiles.
https://nethackwiki.com/wiki/Logfile
*/}}
{{ with .dungeon.max_level }}
<td class="level">{{ .descriptive }}</td>
{{ else }}
{{ with .character.max_level }}<td class="level">Level {{ . }}</td>{{ end }}
{{ end }}
<td class="hp">
{{- $hp := float .character.hp.n -}}
{{- $hpMax := .character.hp.max -}}
{{- if gt $hp 0 }}{{ $hp }} / {{ $hpMax }}{{ else }}{{ $hp }}{{ end }} hp
</td>
</tr>
</table>

View file

@ -1,66 +0,0 @@
<div class="photo-params">
<div class="container">
<table>
{{ if and .Tags.Make .Tags.Model }}
<thead>
<td class="make-model" colspan=4>
{{- $make := .Tags.Make -}}
{{- $model := .Tags.Model -}}
{{- if in $model $make -}}
{{ .Tags.Model }}
{{- else -}}
{{ .Tags.Make }} {{ .Tags.Model }}
{{- end -}}
</td>
</thead>
{{ end }}
{{ with .Tags.LensModel }}
<tr>
<td colspan=4 class="lens">{{ . }}</td>
</tr>
{{ end }}
<tr>
{{- $hasLocation := and .Lat .Long -}}
{{ if $hasLocation -}}
<td colspan=2 class="location">
{{ $lat := float .Lat }}{{ $latDir := cond (eq $lat 0) "" (cond (gt $lat 0) "N" "S") }}
<data class="latitude" value="{{ $lat }}">{{ .Lat | lang.FormatNumber (cond (ne $lat 0) 3 0) }}º{{ $latDir }}</data>,
{{ $long := float .Long }}{{ $longDir := cond (eq $long 0) "" (cond (gt $long 0) "E" "W") }}
<data class="longitude" value="{{ $long }}">{{ .Long | lang.FormatNumber (cond (ne $long 0) 3 0) }}º{{ $longDir }}</data>
</td>
{{- end -}}
{{ if and .Tags.PixelXDimension .Tags.PixelYDimension -}}
<td colspan={{ if $hasLocation }}2{{ else }}4{{ end }} class="size">
{{- $widthpx := .Tags.PixelXDimension -}}
{{- $heightpx := .Tags.PixelYDimension -}}
{{- if and (gt $widthpx 0) (gt $heightpx 0) -}}
{{- $megapixels := div (mul $widthpx $heightpx) 1e6 -}}
<data class="megapixels nobreak" value="{{ $megapixels }}">{{ $megapixels | lang.FormatNumber 0 }} MP</data>
<span class="nobreak"><data class="width">{{ $widthpx }}</data> × <data class="height">{{ $heightpx }}</data></span>
{{- end -}}
</td>
{{ end }}
</tr>
{{ if or .Tags.ISOSpeedRatings .Tags.FocalLengthIn35mmFilm .Tags.FNumber .Tags.ExposureTime }}
<tr class="exposure-attributes">
<td class="iso">{{ with .Tags.ISOSpeedRatings }}ISO {{ . }}{{ end }}</td>
<td class="focal-length">
{{- $focalLength := .Tags.FocalLengthIn35mmFilm | default .Tags.FocalLength -}}
{{- with $focalLength -}}{{ . }} mm{{- end -}}
</td>
<td class="f-number">{{ with .Tags.FNumber }}{{ printf "ƒ%0.1f" . }}{{ end }}</td>
<td class="exposure-time">
{{- with $exposureTime := .Tags.ExposureTime -}}
{{- if in $exposureTime "/" -}}
{{ . }} s
{{- else -}}
1/{{ printf "%.0f" (div 1.0 (float $exposureTime)) }} s
{{- end -}}
{{- end -}}
</td>
</tr>
{{ end }}
</table>
</div>
</div>

View file

@ -1,9 +0,0 @@
{{ $thumbnailResourcesNames := slice "thumbnail" "Thumbnail" "thumbnail.jpg" "Thumbnail.jpg" }}
{{ with index .Params "thumbnail" }}
{{ $thumbnailResourcesNames = $thumbnailResourcesNames | append . }}
{{ end }}
{{ $imageResources := .Resources.ByType "image" }}
{{ $photos := where $imageResources "Name" "not in" $thumbnailResourcesNames }}
{{ return $photos }}

View file

@ -1,50 +0,0 @@
{{/*
Renders a photo thumbnail. If neither a target height or target width are
given, and the image is already in the correct orientation, no image
processing is performed.
Arguments
---------
"Page" : A reference to the current Page
"Height" : The target height of the image
"Width" : The target width of the image
Returns
-------
The processed thumbnail image resource
*/}}
{{- $thumbnailResource := .Page.Resources.GetMatch
(index .Page.Params "thumbnail" | default "[tT]humbnail*")
| default (index (.Page.Resources.ByType "image") 0) -}}
{{- if not $thumbnailResource -}}
{{- errorf "No thumbnail available for %s" .Page.Permalink }}
{{- end -}}
{{ $orientation := partial "images/orientation_angle.html" $thumbnailResource }}
{{ $targetWidth := 0 }}
{{ with .Width }}
{{ $targetWidth = . }}
{{ else }}
{{ $targetWidth = $thumbnailResource.Width }}
{{ end }}
{{ $targetHeight := 0 }}
{{ with .Height }}
{{ $targetHeight = . }}
{{ else }}
{{ $targetHeight = $thumbnailResource.Height }}
{{ end }}
{{ $thumbnail := false }}
{{ if not (and (eq $orientation 0)
(eq $targetWidth $thumbnailResource.Width)
(eq $targetHeight $thumbnailResource.Height)) }}
{{ $thumbnail = $thumbnailResource.Fit (printf "%dx%d r%d" $targetWidth $targetHeight (sub 360 $orientation)) }}
{{ else }}
{{ $thumbnail = $thumbnailResource }}
{{ end }}
{{ return $thumbnail }}

View file

@ -1,30 +0,0 @@
{{ $imports := dict }}
{{ if eq 0 1 }}
{{ with $tsModuleResources := resources.Match "scripts/modules/*/*" }}
{{ range $tsModuleResources }}
{{ $resource := . }}
{{ if eq (path.Ext .) ".ts" }}
{{ $resource = . | js.Build }}
{{ end }}
{{/*
Create imports for these scripts that look like $dirname/$basename
where basename doesn't have the extension
*/}}
{{ $directoryBasename := path.Base (path.Dir $resource) }}
{{ $key := path.Join $directoryBasename (path.BaseName $resource) }}
{{ $imports = merge $imports (dict $key $resource.RelPermalink) }}
{{ end }}
{{ end }}
{{ else }}
{{ $imports = dict "modules/" "scripts/modules/" }}
{{ end }}
{{ $importmap := dict }}
{{ if gt (len $imports) 0 }}
{{ $importmap = dict "imports" $imports }}
{{ end }}
{{ return $importmap }}

View file

@ -1,36 +0,0 @@
{{ $stylesheets := slice }}
{{ with .Resources.Match "*.css" }}
{{ range . }}
{{ $stylesheets = $stylesheets | append . }}
{{ end }}
{{ end }}
{{ if eq .Kind "home" }}
{{ with resources.Get "styles/home.css" }}
{{ $stylesheets = $stylesheets | append . }}
{{ end }}
{{ end }}
{{ $processedStylesheets := slice }}
{{ range $stylesheets }}
{{ $processedStylesheets = $processedStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
{{ end }}
{{ if hugo.IsProduction }}
{{/*
Replace the list of stylesheets that helps with debugging with a
concatenated and fingerprinted version.
*/}}
{{ if gt (len $processedStylesheets) 0 }}
{{ with $file := $.File }}
{{ $outputFilename := printf "%s/page.css" $.File.Dir }}
{{ $processedStylesheets = slice ($processedStylesheets
| resources.Concat $outputFilename
| fingerprint "md5") }}
{{ else }}
{{ warnf "No File for page CSS." }}
{{ end }}
{{ end }}
{{ end }}
{{ return $processedStylesheets }}

View file

@ -1,4 +0,0 @@
{{- $railroadUtilsJS := resources.Get "scripts/railroad-utils.js"
| js.Build
| resources.Fingerprint "md5" -}}
{{ return $railroadUtilsJS }}

View file

@ -1,19 +0,0 @@
{{ $stylesheets := slice (resources.Get "styles/railroad.css")
(resources.Get "styles/monokai.css")
| append (resources.Match "styles/root/*.css" | sort) }}
{{ if not hugo.IsProduction }}
{{ $stylesheets = $stylesheets | append (resources.Get "styles/development.css") }}
{{ end }}
{{ $rootStylesheets := slice }}
{{ range $stylesheets }}
{{ $rootStylesheets = $rootStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
{{ end }}
{{ if hugo.IsProduction }}
{{ $rootStylesheets = slice ($rootStylesheets
| resources.Concat "styles/root.css"
| fingerprint "md5") }}
{{ end }}
{{ return $rootStylesheets }}

View file

@ -1,2 +0,0 @@
{{ $script := resources.Get (printf "scripts/%s.js" .) | fingerprint "md5" }}
{{ return $script }}

View file

@ -1,28 +0,0 @@
{{ $stylesheetName := printf "styles/%s.css" .Section }}
{{ $stylesheets := slice }}
{{ if gt (len .Section) 0 }}
{{ with resources.Match (printf "styles/%s/*" .Section) }}
{{ $stylesheets = . }}
{{ else }}
{{ with resources.Get $stylesheetName }}
{{ $stylesheets = (slice .) }}
{{ end }}
{{ end }}
{{ end }}
{{ $sectionStylesheets := slice }}
{{ if $stylesheets }}
{{ range $stylesheets }}
{{ $sectionStylesheets = $sectionStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
{{ end }}
{{ if hugo.IsProduction }}
{{ $sectionStylesheets = slice ($sectionStylesheets
| resources.Concat $stylesheetName
| minify
| fingerprint "md5") }}
{{ end }}
{{ end }}
{{ return $sectionStylesheets }}

View file

@ -1,2 +0,0 @@
{{ $siteJS := resources.Get "scripts/site.js" | fingerprint "md5" }}
{{ return $siteJS }}

View file

@ -1,11 +0,0 @@
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{ . }}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
{{- range slice "series" "categories" "tags" -}}
{{ range $.GetTerms . }}
{{- $domain := (.Site.GetPage (printf "/%s" .Section)).Permalink -}}
<category domain="{{ $domain }}">{{ .Title }}</category>
{{ end }}
{{- end -}}

View file

@ -1,5 +0,0 @@
{{ if .HasShortcode "ruby" -}}
<aside>
<ruby-switch>
</aside>
{{- end }}

View file

@ -1,9 +0,0 @@
{{ $asset := dict }}
{{ with resources.Get . }}
{{ $secureAsset := . }}
{{ if not (in (site.BaseURL | string) "localhost") }}
{{ $secureAsset = $secureAsset | resources.Fingerprint "md5" }}
{{ end }}
{{ $asset = dict "Resource" . "Secure" $secureAsset }}
{{ end }}
{{ return $asset }}

View file

@ -1,29 +0,0 @@
{{ partial "content_header.html" . }}
{{ partial "table_of_contents.html" . }}
{{- $layout := .Params.layout -}}
{{- $content := .Content -}}
{{ with $layout := .Params.layout }}
<article class="{{ $layout }}">
{{ $content }}
</article>
{{ else }}
{{ $content }}
{{ end}}
<footer>
{{ partial "footer_tags.html" . }}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- if and (gt (len $pages) 1) (in $pages . ) -}}
<nav class="post-nav">
{{ with $pages.Prev . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }}
{{ with $pages.Next . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{- end -}}
</footer>

View file

@ -1,19 +0,0 @@
{{- if .HasShortcode "figures/railroad" -}}
{{- with partial "resources/railroad_utils.html" . -}}
<script defer type="module" src="{{ .RelPermalink }}"></script>
{{- end -}}
{{- end -}}
{{- if .HasShortcode "figures/p5" -}}
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
<script defer src="{{ .Secure.RelPermalink }}"></script>
{{- end -}}
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
<script defer src="{{ .Secure.RelPermalink }}"></script>
{{- end -}}
{{- end -}}
{{- range $script := .Resources.Match "*.js" -}}
{{- $isModule := default true $script.Params.is_module -}}
<script defer {{ if $isModule }}type="module"{{ end }} src="{{ $script.Permalink | relURL }}"></script>
{{- end -}}

View file

@ -1,4 +0,0 @@
{{- range .Resources.Match "*.css" -}}
{{- $stylesheet := . | fingerprint "md5" }}
<link rel="stylesheet" href="{{ $stylesheet.RelPermalink }}"></script>
{{- end -}}

View file

@ -1 +0,0 @@
{{ range (split . "") }}<span>{{ . }}</span>{{ end }}

View file

@ -1,17 +0,0 @@
{{- $currentPage := . -}}
{{- $url := $.RelPermalink -}}
<nav class="site bulleted">
{{ with site.Menus.main }}
{{- range . -}}
<li>
<a
{{ if $currentPage.HasMenuCurrent "main" . }}
class="active"
{{ end }}
href="{{ .URL }}">
<span>{{ .Name }}</span>
</a>
</li>
{{- end -}}
{{ end }}
</nav>

View file

@ -1,8 +0,0 @@
{{ if and (gt .WordCount 400) (.Params.toc | default false) }}
<aside id="table-of-contents">
<details {{ if eq .Params.toc "open" }}open{{ end }}>
<summary>Table of Contents</summary>
{{ .TableOfContents }}
</details>
</aside>
{{ end }}