1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 08:15:32 -04:00

change a BUNCH of if's to with's to prepare for theme extraction

This commit is contained in:
2019-12-03 12:41:55 -05:00
parent ac0bbc6343
commit 96ad258d36
23 changed files with 153 additions and 104 deletions

View File

@@ -1,12 +1,12 @@
<!doctype html>
{{"<!--\n ,,, ,,,\n ;\" ^; ;\" \",\n ; s$$$$$s ;\n , ss$$$$$$$ss ,\"\n ;$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$ Hello, human. :)\n $$$$$\"\"\"$$$\"\"\"$$$$$$\n $$$$$ p\"$$$\"q $$$$$ https://jarv.is/humans.txt\n $$$$ .$$$$$. $$$$\n $$$$$$$$$$$$$$$$$\n \"$$$$\"*\"$$$$\"\n \"$$.$$\"\n-->" | safeHTML}}
<html lang="en">
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
<head>
<meta charset="utf-8">
{{ hugo.Generator }}
<title>{{ .Title }}{{ if not .IsHome }} &ndash; {{ .Site.Title }}{{ else }} &#x1f468;&#x200d;&#x1f4bb;{{ end }}</title>
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta name="author" content="{{ .Site.Author.name }}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
{{ with .Site.Author.name }}<meta name="author" content="{{ . }}">{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ partial "open-graph" . }}
<meta name="apple-mobile-web-app-capable" content="yes">
@@ -23,7 +23,7 @@
<link rel="icon" href="{{ "favicon-16.png" | absURL }}" sizes="16x16">
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}" sizes="16x16 32x32 48x48">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="alternate" type="application/rss+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
<link rel="alternate" type="application/rss+xml" href="{{ "feed.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
<link rel="author" href="{{ "humans.txt" | absURL }}">
{{ if and (eq .Type "notes") (eq .Kind "page") }}
{{ with .OutputFormats.Get "amp" }}

View File

@@ -1,17 +1,21 @@
{{ define "main" }}
<main id="list">
{{- range (where .Site.RegularPages "Type" "notes").GroupByDate "2006" }}
{{- with (where .Site.RegularPages "Type" "notes") }}
{{- range .GroupByDate "2006" }}
<section class="year">
<h2>{{ .Key }}</h2>
<ul>
{{- range .Pages }}
{{- with .Pages }}
{{- range . }}
<li>
<div class="date">{{ .Date.Format "Jan 2" }}</div>
<div class="title"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
</li>
{{- end }}
{{- end }}
</ul>
</section>
{{- end }}
{{- end }}
</main>
{{ end }}

View File

@@ -13,7 +13,7 @@
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta name="author" content="{{ .Site.Author.name }}">
{{ partial "open-graph.html" . }}
{{ partial "open-graph" . }}
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<style amp-custom>
@@ -154,15 +154,16 @@
<link rel="icon" href="{{ "favicon-32.png" | absURL }}" sizes="32x32">
<link rel="icon" href="{{ "favicon-16.png" | absURL }}" sizes="16x16">
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}">
<link rel="alternate" type="application/rss+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
{{ partial "schema-person.html" . }}
{{ partial "schema-article.html" . }}
<link rel="alternate" type="application/rss+xml" href="{{ "feed.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
{{ partial "schema-person" . }}
{{ partial "schema-article" . }}
</head>
<body>
<header>
<nav>
<a id="logo" href="{{ .Site.BaseURL }}" title="{{ .Site.Title }}">
{{ partial "logo.html" . }}
{{ partial "logo" . }}
<span id="name">{{ .Site.Title }}</span>
</a>

View File

@@ -6,11 +6,13 @@
<div id="byline">
by <a class="no-underline" href="{{ .Site.BaseURL }}" rel="me author">{{ .Site.Author.name }}</a>
&middot; <a class="no-underline" href="{{ .Permalink }}" title="{{ .Date.Format "Mon, Jan 2 2006 3:04:05 PM MST" }}">{{ .Date.Format "January 2, 2006" }}</a>
&middot; <a class="no-underline" href="{{ .Site.Params.gitRepo }}/blob/master/content/{{ .File.Path }}" title="Edit this page on GitHub" target="_blank" rel="noopener">Improve Post</a>
{{ with .Site.Params.gitRepo }}&middot; <a class="no-underline" href="{{ . }}/blob/master/content/{{ $.File.Path }}" title="Edit this page on GitHub" target="_blank" rel="noopener">Improve Post</a>{{ end }}
<ul id="tags">
{{- range .Params.tags }}
{{- with .Params.tags }}
{{- range . }}
<li>{{ . }}</li>
{{- end }}
{{- end }}
</ul>
</div>
</div>

View File

@@ -2,7 +2,9 @@
<main id="video">
<h1>{{ .Title }}</h1>
<video poster="{{ with .Resources.GetMatch "images/*.png" }}{{ .Permalink }}{{ end }}" controls crossorigin playsinline preload="none">
<video
{{ with .Resources.GetMatch "images/*.png" }}poster="{{ .Permalink }}"{{ end }}
controls crossorigin playsinline preload="none">
{{ with .Resources.GetMatch "*.webm" }}<source src="{{ .Permalink }}" type="video/webm">{{ end }}
{{ with .Resources.GetMatch "*.mp4" }}<source src="{{ .Permalink }}" type="video/mp4">{{ end }}
{{ with .Resources.GetMatch "*.ogg" }}<source src="{{ .Permalink }}" type="video/ogg">{{ end }}