Merge branch 'redesign'

This commit is contained in:
Eryn Wells 2022-10-09 12:55:01 -07:00
commit 9ae600d8ce
36 changed files with 1236 additions and 851 deletions

View file

@ -3,11 +3,41 @@
{{ partial "head.html" . }}
<body>
<main class="main">
{{ block "body" . }}
{{ block "header" . }}{{ end }}
<main class="{{ .Type }}">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
{{ partial "development/page_info.html" . }}
{{ block "footer" . }}{{ end }}
{{ end }}
</body>
<style>
@font-face {
font-family: "Museo_Slab";
src: url("{{ `/fonts/Museo_Slab_500.woff2` | absURL }}") format("woff2"),
url("{{ `/fonts/Museo_Slab_500.woff` | absURL }}") format("woff");
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" as="style" href="{{ `/styles/reset.css` | absURL }}">
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | absURL }}">
{{ if not hugo.IsProduction }}
<link rel="stylesheet" as="style" href="/styles/development.css">
{{ end }}
{{ block "styles" . }}{{ end }}
{{ if gt (len .Section) 0 }}
{{ range .FirstSection.Resources.Match "*.css" }}
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
{{ end }}
{{ end }}
{{ range .Resources.Match "*.css" }}
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
{{ end }}
{{ block "scripts" . }}{{ end }}
<script src="{{ `scripts/site.js` | absURL }}"></script>
</html>

View file

@ -1,11 +1,22 @@
{{ define "main" }}
{{ if .Title }}
<h1 class="main-title">{{ .Title }}</h1>
{{ end }}
<section id="homepage-content">
{{ .Content }}
</section>
<div class="platter">
<div class="grid">
<div id="title">
<h1 class="site">{{ .Title }}</h1>
</div>
<div id="content">
{{ .Content }}
</div>
{{ with site.Menus.main }}
{{ $url := $.RelPermalink }}
<div id="nav">
<nav class="site bulleted">
{{ range . }}
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
{{ end }}
</nav>
</div>
{{ end }}
</div>
</div>
{{ end }}

View file

@ -1,44 +0,0 @@
{{ define "main" }}
{{ if .Title }}
<header>
<h1 class="main-title">{{ .Title }}</h1>
</header>
{{ end }}
{{ $pages := union .RegularPages .Sections }}
{{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
{{ .Content }}
<ul class="post-list">
{{ $paginator := .Paginate $pages }}
{{ range $index, $page := $paginator.Pages }}
<li class="post-entry">
<header>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<div class="post-date">
<time class="nobreak" datetime="{{ .Date | time.Format " 2006-01-02" }}">{{ .Date | time.Format "January 2, 2006" }}</time>
</div>
{{ partial "development/draft_tag.html" . }}
</header>
{{ if .Description }}
<article>{{ .Description }}</article>
{{ end }}
</li>
{{ end }}
</ul>
{{ if gt $paginator.TotalPages 1 }}
<nav class="main-nav">
{{ if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
{{ end }}<!---->
{{ if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
{{ end }}
</nav>
{{ end }}
{{ end }}

View file

@ -1,39 +1,37 @@
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
<article class="post-single">
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div>
</header>
<section class="post-content">
{{ .Content }}
</section>
{{ partial "single_main.html" . }}
{{ end }}
<!-- Post Tags -->
{{ if .Params.tags }}
<footer>
<ul class="post-tags">
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
<li><a href="{{ $href }}">{{ . }}</a></li>
{{ end }}
</ul>
</footer>
{{ define "styles" }}
{{ if .Page.Scratch.Get "includes_railroad_diagram" }}
<link rel="preload stylesheet" as="style" href="{{ `styles/railroad.css` | absURL }}">
{{ end }}
<link rel="preload stylesheet" as="style" href="{{ `styles/monokai.css` | absURL }}">
{{ end }}
{{ define "scripts" }}
{{ if and .IsPage (.Page.Scratch.Get "includes_railroad_diagram") }}
<script defer type="module" src="{{ `scripts/railroad.js` | absURL }}"></script>
<script defer type="module" src="{{ `scripts/railroad-utils.js` | absURL }}"></script>
{{ end }}
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Next . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{ if .Page.Scratch.Get "includes_p5_sketch" }}
<script defer src="{{ `scripts/p5-1.4.1.min.js` | absURL }}"></script>
<script defer src="{{ `scripts/sketch-utils.js` | absURL }}"></script>
{{ end }}
</article>
{{ 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 }}
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}
{{ define "scripts" }}

View file

@ -0,0 +1,4 @@
{
"title": "{{ .Title }}",
"main": "{{ partial `single_main.html` . }}"
}

36
layouts/blog/list.html Normal file
View file

@ -0,0 +1,36 @@
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{ $pages := union .RegularPages .Sections }}
{{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
{{ range .Pages.ByDate.GroupByDate "2006" }}
<h2>{{ .Key }}</h2>
<ul class="post-list">
{{ range .Pages }}
{{ if or (not .Draft) (and .Draft (not hugo.IsProduction)) }}
<li>
<h1>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ partial "development/draft_tag.html" . }}
</h1>
<time class="nobreak" datetime="{{ .Date | time.Format "2006-01-02" }}">{{ .Date | time.Format "January" }}</time>
<time class="nobreak" datetime="{{ .Date | time.Format "2006-01-02" }}">{{ .Date | time.Format "2" }}</time>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}
{{ define "styles" }}
<link rel="preload stylesheet" as="style" href="{{ `/styles/main.css` | absURL }}">
{{ end }}

View file

@ -0,0 +1,11 @@
{{ if not hugo.IsProduction }}
<div class="platter" id="debug-page-info">
<details>
<summary>Debug Page Info</summary>
<table>
<tr><td>.Section</td><td>{{ .Section }}</td></tr>
<tr><td>.Type</td><td>{{ .Type }}</td></tr>
</table>
</details>
</div>
{{ end }}

View file

@ -1,4 +1,10 @@
<footer class="footer">
<p class="slogans"><span>Trans rights are human rights.</span> <span>Black lives matter.</span> <span>Get vaccinated.</span></p>
<p>Copyright © <time datetime="{{ now.Year }}">{{ now.Year }}</time> <a href="{{ `` | absURL }}">Eryn Wells</a></p>
<footer class="site">
<div>
<ul class="slogans">
<li>Trans rights are human rights.</li>
<li>Black lives matter.</li>
<li>Get vaccinated.</li>
</ul>
<p>Copyright © <time datetime="{{ now.Year }}">{{ now.Year }}</time> <a href="{{ `` | absURL }}">Eryn Wells</a></p>
</div>
</footer>

View file

@ -13,22 +13,6 @@
<meta name="author" content="{{ site.Author.name }}">
{{ end }}
<link rel="preload stylesheet" as="style" href="{{ `/styles/main.css` | absURL }}">
{{ if or (eq .Kind "list") (eq .Kind "term") }}
<link rel="preload stylesheet" as="style" href="{{ `styles/list.css` | absURL }}">
{{ end }}
{{ if and .IsPage (.Page.Scratch.Get "includes_railroad_diagram") }}
<link rel="preload stylesheet" as="style" href="{{ `styles/railroad.css` | absURL }}">
{{ end }}
{{ range $stylesheet := .Resources.Match "*.css" }}
<link rel="preload stylesheet" as="style" href="{{ $stylesheet.Permalink }}">
{{ end }}
{{ if in (.Site.BaseURL | string) "localhost" }}
<link rel="preload stylesheet" as="style" href="/styles/development.css">
{{ end }}
{{ if .IsPage }}
<link rel="preload stylesheet" as="style" href="{{ `styles/monokai.css` | absURL }}">
{{ end }}
{{ range $.Scratch.Get "social-list" }}
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}">
@ -43,6 +27,7 @@
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ site.Title }}">
{{ end }}
<!-- Misc -->
{{ if or hugo.IsProduction (eq site.Params.env "production") }}
{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}

View file

@ -1,27 +1,31 @@
<header class="header">
<div class="title-and-menu">
<h1><a class="site-name" href="{{ `` | absURL }}">Eryn Wells</a></h1>
<header class="site">
<div class="platter">
<div class="grid">
<h1 class="site">
<a class="site-name" href="{{ `` | absURL }}">Eryn Wells</a>
</h1>
{{ $url := .RelPermalink }}
{{ with site.Menus.main }}
<nav class="menu">
<menu>
{{ range . }}
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
{{ $url := .RelPermalink }}
{{ with site.Menus.main }}
<nav class="site bulleted">
{{ range . }}
{{ if eq .URL $url }}
<li class="active"><span>{{ .Name }}</span></li>
{{ else }}
<li><a href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
{{ end }}
{{ end }}
</nav>
{{ end }}
</menu>
</nav>
{{ end }}
<nav class="site social">
<li><a style="--url: var(--twitter-icon)" href="https://twitter.com/erynofwales" target="_blank" aria-label="twitter"><span>tw</span></a></li>
<li><a style="--url: var(--github-icon)" href="https://github.com/erynofwales" target="_blank" aria-label="github"><span>gh</span></a></li>
<li><a style="--url: var(--instagram-icon)" href="https://instagram.com/erynofwales" target="_blank" aria-label="instagram"><span>ig</span></a></li>
{{ with .OutputFormats.Get "rss" }}
<li><a style="--url: var(--rss-icon)" href="{{ .RelPermalink }}" aria-label="rss"><span>rss</span></a></li>
{{ end }}
</nav>
</div>
</div>
<nav class="social">
<menu>
<li><a style="--url: var(--twitter-icon)" href="https://twitter.com/erynofwales" target="_blank" aria-label="twitter"><span>tw</span></a></li>
<li><a style="--url: var(--github-icon)" href="https://github.com/erynofwales" target="_blank" aria-label="github"><span>gh</span></a></li>
<li><a style="--url: var(--instagram-icon)" href="https://instagram.com/erynofwales" target="_blank" aria-label="instagram"><span>ig</span></a></li>
{{ with .OutputFormats.Get "rss" }}
<li><a style="--url: var(--rss-icon)" href="{{ .RelPermalink }}" aria-label="rss"><span>rss</span></a></li>
{{ end }}
</menu>
</nav>
</header>

View file

@ -0,0 +1,37 @@
<article class="post-single">
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
{{ if not (eq .Type "page") }}
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
{{ end }}
</div>
</header>
<section class="post-content">
{{ .Content }}
</section>
<footer>
{{ if .Params.tags }}
<ul class="tags">
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
<li><a href="{{ $href }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ $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>
</article>

View file

@ -1,25 +1,17 @@
{{ define "main" }}
<article id="resume" class="post-single">
<header class="post-title">
<h1>{{ .Title }}</h1>
</header>
<section class="post-content">
{{ .Content }}
</section>
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Next . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{ end }}
</article>
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
<header class="post-title">
<h1>{{ .Title }}</h1>
</header>
<section class="post-content">
{{ .Content }}
</section>
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}

View file

@ -0,0 +1,5 @@
{{ $lang := .Get "lang" }}
{{ $trimmedCode := trim .Inner "\n " }}
<figure class="code">
{{ transform.Highlight $trimmedCode $lang }}
</figure>

View file

@ -1,14 +1,10 @@
{{ $img := (.Page.Resources.GetMatch (.Get "name")) }}
{{ $resized_img := $img.Fit "1280x1280" }}
<div class="centered">
<figure>
<a href="{{ $img.RelPermalink }}">
<img src="{{ $resized_img.RelPermalink }}" />
</a>
{{ if $img.Title }}
<figcaption>
<p>{{ $img.Title }}</p>
</figcaption>
{{ end }}
</figure>
</div>
<figure>
<a href="{{ $img.RelPermalink }}">
<img src="{{ $resized_img.RelPermalink }}" />
</a>
{{ if $img.Title }}
<figcaption>{{ $img.Title }}</figcaption>
{{ end }}
</figure>

View file

@ -4,11 +4,9 @@
{{- $id := .Get "id" | default (.Get 0) -}}
{{- $class := .Get "class" | default (.Get 1) -}}
{{- $title := .Get "title" | default "YouTube Video" }}
<div class="centered">
<figure>
<div class="youtube">
<iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" allowfullscreen frameborder=0 title="{{ $title }}"></iframe>
</div>
</figure>
</div>
<figure>
<div class="youtube">
<iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" allowfullscreen frameborder=0 title="{{ $title }}"></iframe>
</div>
</figure>
{{ end -}}

View file

@ -1,12 +1,21 @@
{{ define "main" }}
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
<article class="post-single">
<header class="post-title">
<h1>{{ .Title }}</h1>
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
</div>
</header>
<section class="post-content">
{{ .Content }}
</section>
</article>
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}