switch to new theme due to old theme not liking newer versions. New theme seems kick-arse, however

This commit is contained in:
Don Harper 2019-08-17 19:36:46 -05:00
parent 1909ea34ea
commit e3ac8b96f5
531 changed files with 147790 additions and 66 deletions

View file

@ -0,0 +1,24 @@
{{ define "title" }}Archives • {{ .Site.Title }}{{ end }}
{{ define "main" }}
<section class="center bg-white br-3 pv1 ph4 nested-copy-line-height lh-copy f4 nested-links mw-100 measure-wide">
{{- range $i, $p := .Site.RegularPages -}}
{{- $thisYear := $p.Date.Format "2006" }}
{{- $lastPage := $i | add -1 | index .Site.RegularPages }}
{{- if or (eq $i 0) ( ne ($lastPage.Date.Format "2006") $thisYear ) }}
<h3 class="archive-year">{{ $thisYear }}</h3>
{{- end }}
<div>
{{ $p.Date.Format "01-02" }}
<a href="{{ $p.Permalink }}" class="no-underline dim link">
{{- cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) -}}
</a>
</div>
{{- end -}}
</section>
{{ end }}
{{ define "pagination" }}
<br>
{{ end }}

View file

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ "index.xml" | absURL }}">
<link rel="canonical" href="{{ .Permalink }}">
<!-- the Story logo is a square with rounded corners interlocked with a section symbol in Bodoni 72 Book font -->
<link rel="shortcut icon" type="image/png" href="{{ "apple-touch-icon-precomposed.png" | absURL }}">
{{ with .Description }}<meta name="description" content="{{. | markdownify }}">{{ end }}
{{ with .Keywords }}<meta name="keywords" content="{{.}}">{{ end }}
{{ .Hugo.Generator }}
{{ block "social" . }}
{{ end }}
{{ block "layout" . }}
<link rel="stylesheet" href="{{ "css/tachyons.min.css" | absURL }}" />
{{- if .Site.Params.less -}}
<link rel="stylesheet/less" type="text/css" href="{{ "css/story.less" | absURL }}" />
<link rel="stylesheet/less" type="text/css" href="{{ "css/descartes.less" | absURL }}" />
<script type="text/javascript" src="{{ "js/less.min.js" | absURL }}"></script>
{{ else }}
<link rel="stylesheet" href="{{ "css/story.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/descartes.css" | absURL }}" />
{{ end }}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400i,700,700i|Quattrocento:400,700|Spectral:400,400i,700,700i&amp;subset=latin-ext" rel="stylesheet">
{{ end }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
{{ if or (in .Site.Params.classes "feature-highlight") (in .Params.classes "feature-highlight") -}}
{{- if not (or (in .Site.Params.classes "feature-nohighlight") (in .Params.classes "feature-nohighlight") ) -}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{- end -}}
{{- end -}}
{{ if or (in .Site.Params.classes "feature-math") (in .Params.classes "feature-math") -}}
{{- if not (or (in .Site.Params.classes "feature-nomath") (in .Params.classes "feature-nomath") ) -}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.9.0/dist/katex.min.css" integrity="sha384-TEMocfGvRuD1rIAacqrknm5BQZ7W7uWitoih+jMNFXQIbNl16bO8OZmylH/Vi/Ei" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.9.0/dist/katex.min.js" integrity="sha384-jmxIlussZWB7qCuB+PgKG1uLjjxbVVIayPJwi6cG6Zb4YKq0JIw+OMnkkEC7kYCq" crossorigin="anonymous"></script>
<script src="{{ "js/auto-render.min.js" | absURL }}"></script> <!-- for KaTeX -->
{{- end -}}
{{- end -}}
{{ if or (in .Site.Params.classes "feature-music") (in .Params.classes "feature-music") -}}
{{- if not (or (in .Site.Params.classes "feature-nomusic") (in .Params.classes "feature-nomusic") ) -}}
<script src="{{ "js/abcjs_basic_5.6.3-min.js" | absURL }}"></script>
{{- end -}}
{{- end -}}
{{ with .Site.Params.head }}{{ range . }}
{{ . | safeHTML }}{{ end }}{{ end }}
<script src="{{ "js/story.js" | absURL }}"></script>
</head>
<body class="ma0 bg-white {{ with .Section }}section-{{ . }}{{ end }} page-kind-{{ .Kind }} is-page-{{ .IsPage }} {{ with .Site.Params.classes }}{{ range . }} {{ . }}{{ end }}{{ end }}{{ with .Params.classes }}{{ range . }} {{ . }}{{ end }}{{ end }}">
{{ block "header" . }}
<!--
You can set the title and header image in the "title/image" parameters of
the _index.md for the section. For a post, you can set the header image
with the "image" parameter in front matter. You can disable these
behaviors with the feature-nohdr class in the site config file or front
matter of an individual post.
-->
{{- $hdr := cond (or (in .Site.Params.classes "feature-nohdr") (in .Params.classes "feature-nohdr")) false true -}}
<header class="cover bg-top" {{ if $hdr }}style="background-image: url('{{ absURL (default "img/default-header-img.jpg" .Params.image) }}'); background-position: center;"{{ end }}>
<div class="{{ cond $hdr "bg-black-30 bb bt" "" }}">
<nav class="hide-print sans-serif {{ cond $hdr "" "bg-black" }} border-box pa3 ph5-l">
<a href="{{ .Site.BaseURL }}" title="Home">
<img src="{{ absURL (default "img/logo.jpg" (default .Site.Params.logo)) }}" class="w2 h2 br-100" alt="{{ .Site.Title }}" />
</a>
<div class="fr h2 pv2 tr">
{{- range .Site.Menus.main }}
<a class="link f5 ml2 dim near-white" href="{{ .URL }}">{{ .Name }}</a>
{{- end }}
{{- range .Site.Menus.social }}
<a class="link f5 ml2 dim near-white" href="{{ .URL }}"><i class="{{ .Title }}"></i></a>
{{- end }}
<a class="link f5 ml2 dim near-white fas fa-rss-square" href="{{ "index.xml" | absURL }}" title="RSS Feed"></a>
<a class="link f5 ml2 dim near-white fas fa-search" href="{{ "search/" | absURL }}" role="search" title="Search"></a>
</div>
</nav>
<div id="hdr" class="tc-l {{ cond $hdr "pv4-ns pv5-l" "" }} pv2 ph3 ph4-ns">
<h1 class="{{ cond $hdr "near-white mt1-ns" "" }} f2 fw3 mb0 mt0 lh-title">{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}</h1>
<h2 class="{{ cond $hdr "near-white mt3-l mb4-l" "" }} fw1 f6 f3-l measure-wide-l center lh-copy mt2 mb3">
<!-- You can put a subtitle here in _index.md parameters, or it'll get
filled in with date and categories if it's a post -->
{{ if .IsPage }}
{{ if eq .Section "talks" }}
Presented
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}}
</time>
at <a class="no-underline category {{ cond $hdr "near-white dim" "black hover-gray" }}" href="{{ .Params.site }}">{{ .Params.event }}</a>
{{ else }}
Published
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "Jan 2, 2006" -}}
</time>
<span class="display-print">by {{ .Params.author | default .Site.Params.author }}</span>
{{ range $idx, $cat := .Params.categories }}{{ if gt $idx 0 }}, {{ end }}{{ if eq $idx 0 }} in {{ end }}<a href="{{ "categories" | absURL }}/{{ . | urlize }}" class="no-underline category {{ cond $hdr "near-white dim" "black hover-gray" }}">{{ . | title }}</a>{{ end }}
<span class="display-print">at {{ .Permalink }}</span>
{{ end }}
{{ else }}
{{ with .Params.subtitle }}{{ . | markdownify }}{{ end }}
{{ end }}
</h2>
</div>
<!-- if there's a "credits" parameter in front matter there'll be a camera icon here -->
{{ if $hdr }}
{{ with .Params.credit }}
<div class="w-100 cf hide-print">
<a class="fr f6 ma0 pa2 link white-50 dim fas fa-camera" href="{{ . }}" title="Photo Credit"></a>
</div>
{{ end }}
{{ end }}
</div>
</header>
{{ end }}
<main role="main">
{{ block "main" . }}
{{ end }}
</main>
{{ block "about" . }}
{{ partial "about.html" . }}
{{ end }}
{{ block "pagination" . }}{{ end }}
{{ block "footer" . }}
<footer class="hide-print sans-serif f6 fw1 bg-black near-white bottom-0 w-100 pa3" role="contentinfo">
<p class="w-50 fr tr">
<a class="no-underline near-white" href="https://github.com/xaprb/story"><img class="dib" title="Made with Hugo and Story" alt="Story logo" src="{{ "img/story-logo-white.svg" | absURL }}" style="width: 1.5rem; height: 1.5rem" /></a>
</p>
<p class="w-50 near-white">
&copy; {{ now.Format "2006" }} {{ with .Site.Params.author }}{{ . }}{{ end }}
</p>
</footer>
{{ end }}
{{ template "_internal/google_analytics_async.html" . }}
{{ with .Site.Params.foot }}{{ range . }}
{{ . | safeHTML }}{{ end }}{{ end }}
</body>
</html>

View file

@ -0,0 +1,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }} </title>
<link>{{ .Permalink }}</link>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<author>{{ .Site.Params.Author }}</author>
<rights>Copyright (c) {{ .Site.LastChange.Year }}</rights>
<updated>{{ .Date }}</updated>
{{ range where (where (where .Data.Pages "Section" "ne" "slides") ".Params.skip" "ne" "true") ".Date.Unix" "<" now.Unix }}
<item>
<title>{{ cond (eq .Site.Params.titlecase true) (.Title | title) (.Title) }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }}</pubDate>
<author>{{ .Site.Params.Author }}</author>
<guid>{{ .Permalink }}</guid>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="{{ (absURL (default (default "img/default-header-img.tn-500x500.jpg" .Params.image) .Params.thumbnail)) }}" medium="image" type="image/jpg" width="100" height="100" />
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,30 @@
{{ define "title" }}{{ .Section | title }} &bullet; {{ .Site.Title }}{{ end }}
{{ define "main" }}
<div class="pa3 pa4-ns w-100 w-70-ns center">
<section class="w-100 mw8">
<!-- list all talks; list non-future slides; else list things that are not future and not slides -->
{{ $pages := where .Paginator.Pages ".Params.skip" "ne" "true" }}
{{ if eq .Section "talks" }}
{{ range $pages }}
{{ partial "li.html" . }}
{{ end }}
{{ else if eq .Section "slides" }}
{{ range where $pages ".Date.Unix" "<" now.Unix }}
{{ partial "li.html" . }}
{{ end }}
{{ else }}
{{ range where (where $pages ".Date.Unix" "<" now.Unix) "Section" "ne" "slides" }}
{{ partial "li.html" . }}
{{ end }}
{{ end }}
</section>
</div>
{{ end }}
{{ define "pagination" }}
<footer class="w-100 sans-serif" role="contentinfo">
<nav class="w-third-l pb3 f6 center db" role="navigation">
{{- template "_internal/pagination.html" . -}}
</nav>
</footer>
{{ end }}

View file

@ -0,0 +1,38 @@
{{ define "title" }}{{ .Section | title }} &bullet; {{ .Site.Title }}{{ end }}
{{ define "main" }}
<div class="pa3 pa4-ns w-100 w-70-ns center">
<section class="w-100 mw8">
{{- $hdr := cond (or (in .Site.Params.classes "feature-nohdr") (in .Params.classes "feature-nohdr")) false true -}}
{{ range first 20 (where (where (where .Site.RegularPages "Section" "ne" "slides") ".Params.skip" "ne" "true") ".Date.Unix" "<" now.Unix) }}
<div class="relative w-100">
<article>
<div class="db pv4 {{ cond $hdr "ph3" "" }} ph0-l no-underline dark-gray">
<div class="flex flex-column flex-row-ns">
{{ if $hdr }}
<div class="mb4 mb0-ns w-100 h4 h4-m w4-m h5-ns w5-ns br3 cover {{ if lt .Date.Unix now.Unix }}hide-child{{ end }}" style="background-image: url('{{ absURL (default "img/default-header-img.tn-500x500.jpg" (default .Params.image .Params.thumbnail)) }}'); background-position: center;">
<a href="{{ .Permalink }}" class="sans-serif db child w-100 h-100 f7 lh-copy white no-underline br3 ph3 pt4 pt5-l ttu tc bg-black-60">
<i class="mt3 mt5-l child far {{ cond (gt .Date.Unix now.Unix) "fa-hourglass" "fa-calendar-alt" }}"></i> {{ .Date.Format "Jan 2, 2006" }}
</a>
</div>
{{ end }}
<div class="w-100 w6-ns pl3-ns">
<h1 class="f3 fw1 mt0 lh-title"><a href="{{ .Permalink }}" class="color-inherit dim link">
{{- cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) -}}
</a></h1>
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
{{ with .Params.tldr }}{{ . | markdownify }}{{ else }}{{ (printf "%s<br>%s" (.Params.description | markdownify) .Summary) }}{{ end }}
</div>
</div>
</div>
</div>
</article>
</div>
{{ end }}
</section>
</div>
{{ end }}
{{ define "pagination" }}
<br>
{{ end }}

View file

@ -0,0 +1,22 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }} </title>
<link>{{ .Permalink }}</link>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<author>{{ .Site.Params.Author }}</author>
<rights>Copyright (c) {{ .Site.LastChange.Year }}</rights>
<updated>{{ .Date }}</updated>
{{ range first 20 (where (where (where .Site.RegularPages "Section" "ne" "slides") ".Params.skip" "ne" "true") ".Date.Unix" "<" now.Unix) }}
<item>
<title>{{ cond (eq .Site.Params.titlecase true) (.Title | title) (.Title) }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }}</pubDate>
<author>{{ .Site.Params.Author }}</author>
<guid>{{ .Permalink }}</guid>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="{{ (absURL (default (default "img/default-header-img.tn-500x500.jpg" .Params.image) .Params.thumbnail)) }}" medium="image" type="image/jpg" width="100" height="100" />
<description>{{ with .Params.tldr }}{{ . | markdownify | html }}{{ else }}{{ (printf "%s<br>%s" .Params.description .Summary) | markdownify | html }}{{ end }}</description>
</item>
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,116 @@
{{ define "title" }}Search{{ end }}
{{ define "main" }}
<article class="center ph3 nested-copy-line-height lh-copy f4 nested-links mw-100 measure-wide pt4 min-vh-100">
{{ .Content }}
<input id="search" type="text" placeholder="Search..." class="pa2 br3 ba bw1 b--gray lh-title f3 sans-serif w-100">
<p>Type a search above to see results below:</p>
<ul id="results" class=""></ul>
</article>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.2.1/lunr.min.js"></script>
<script type="text/javascript">
var lunrIndex, $results, pagesIndex;
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (pair[0] === variable) {
return decodeURIComponent(pair[1].replace(/\+/g, '%20'));
}
}
}
var searchTerm = getQueryVariable('query');
// Initialize lunrjs using our generated index file
function initLunr() {
// First retrieve the index file
$.getJSON("{{ "index.json" | absURL }}")
.done(function(index) {
pagesIndex = index;
// console.log("index:", pagesIndex);
lunrIndex = lunr(function() {
this.field("title", { boost: 10 });
this.field("categories", { boost: 5 });
this.field("keywords");
this.field("content");
this.field("uri");
this.ref("uri");
pagesIndex.forEach(function (page) {
this.add(page)
}, this)
});
})
.fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.error("Error fetching Hugo search index JSON file:", err);
});
}
// Nothing crazy here, just hook up a listener on the input field
function initUI() {
$results = $("#results");
$("#search").keyup(function() {
$results.empty();
// Only trigger a search when 2 chars. at least have been provided
var query = $(this).val();
if (query.length < 2) {
return;
}
var results = search(query);
renderResults(results);
});
}
/**
* Trigger a search in lunr and transform the result
*
* @param {String} query
* @return {Array} results
*/
function search(query) {
return lunrIndex.search(query).map(function(result) {
return pagesIndex.filter(function(page) {
return page.uri === result.ref;
})[0];
});
}
/**
* Display the 10 first results
*
* @param {Array} results to display
*/
function renderResults(results) {
if (!results.length) {
return;
}
// Only show the first results
results.slice(0, 20).forEach(function(result) {
var $result = $("<li>");
$result.append($('<a>', {
class: 'no-underline dim link',
href: result.uri,
text: result.title
}));
$results.append($result);
});
}
// Let's get started
$(document).ready(function() {
initLunr();
initUI();
});
</script>
{{ end }}

View file

@ -0,0 +1,18 @@
{{ define "title" }}{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}{{ end }}
{{ define "main" }}
<article class="center bg-white br-3 pv1 ph4 lh-copy f5 nested-links mw7">
{{ .Content }}
</article>
{{ end }}
{{ define "social" }}
<meta property="og:title" content="{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}" />
<meta property="og:type" content="article" />
<meta property="og:image" content="{{ default "img/default-header-img.jpg" .Params.image | absURL }}" />
<meta property="og:description" content="{{ .Description | markdownify }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}" />
{{ end }}