huge refactoring styling, related links, belowsingle, ...

This commit is contained in:
Wouter Groeneveld 2022-11-12 21:29:17 +01:00
parent 46f2624724
commit 84e8072187
26 changed files with 265 additions and 413 deletions

View File

@ -19,7 +19,7 @@ enableGitInfo = true
pagination = 30
description = "Freshly Baked Thoughts"
webmentionServer = "https://jam.brainbaking.com"
copyright = "&uarr;&nbsp;<a href='#header'>Top</a> <svg class='icon icon-small' width='16' height='16'><title>lightbulb icon</title><use xlink:href='#bulb'></use></svg> <a href='/'>Brain Baking</a>. <a href='/no-copyright-no-tracking'>No &copy; and no tracking</a>."
copyright = "&uarr;&nbsp;<a href='#header'>Top</a> <svg class='icon icon-small' width='16' height='16'><title>lightbulb icon</title><use xlink:href='#bulb'></use></svg> <a href='/'>Brain Baking</a> | <a href='/archives'>Archives</a> | <a href='/no-copyright-no-tracking'>No &copy; no tracking</a>."
[Author]
name = "Wouter Groeneveld"

View File

@ -5,26 +5,26 @@ bigimg: About Me.jpg
disableComments: true
---
And I'm currently an experienced multiclass ...
And I'm currently an multiclass ...
### ... Baker
## ... Baker
I hold a professional bread baker's degree so naturally I love to think of myself as a real baker. I highly respect the craft and enjoy kneading dough with my hands. I specialize in _sourdough bread_, as you can read at my [bread baking blog](https://redzuurdesem.be). I've written a book on [the science of sourdough bread](https://redzuurdesem.be/het-boek) (in Dutch).
### ... Researcher
## ... Researcher
I am a PhD researcher at the Faculty of Engineering Technology, KU Leuven. My academic research focuses on identifying and amplifying non-technical skills in software engineering education, primarily targetting _creative problem solving_. I sometimes [blog about my work](/tags/phd).
### ... Programmer
## ... Programmer
I'm an experienced software engineer and took on various roles from agile coaching to technical lead. I hold a Master of Computer Science. I also dabble in open source, have a peek at https://git.brainbaking.com/. Im a big Test Driven Development advocate. I teach software engineering techniques in both industry and academia.
### ... Writer
## ... Writer
I like fountain pens and [<svg class='icon icon-text'><use xlink:href='#book'></use></svg>journaling](/tags/journaling/). I love jotting down stuff and possibly converting that into blog posts, academic articles, books, or any other medium where I can express my enthusiasm.
### ... Teacher
## ... Teacher
Transforming knowledge into well-digestible material is my mission. As they say: _the best way to learn something is to teach it_ - I couldn't agree more. Besides various formal teaching assignments at KU Leuven, I've also coached software developers in different companies, and occasionally organize bread baking workshops.
@ -61,21 +61,3 @@ There are multiple concepts all defining the same thing:
I used to be only good at programming because I thought, as a Computer Scientist, you specialize instead of generalize. But the more I worked with computers, the more my hands itched to do something else. So nowadays I love to go wide and pass on that enthusiasm for knowledge on any level.
---
## Where good ideas come from: books
I keep an active <a href="https://www.goodreads.com/user/show/5451893-wouter" target="_blank"><svg class='icon'><use xlink:href='#goodreads'></use></svg>Goodreads</a> account where I manage everything I've read and want to read. I invite you to join the community there. Marking a book as read and writing a (short) review never was that satisfying...
I used to be almost exclusively a fantasy reader. Now I mostly read non-fiction on the most diverse topics, but I do have a soft spot for things like philosophy, art, mindful food and software engineering.
These are the latest 12 books I've read:
</main>
<div id="gr_grid_widget_1496758344" class="goodreadswidget">
</div>
<script src="/js/goodreads.js" type="text/javascript" charset="utf-8"></script>
<main>
<p style="clear: both;">&nbsp;</p>

View File

@ -1,6 +1,7 @@
---
title: Freshly Baked Thoughts
icontag: book
disableComments: true
---
Below is a list of every fully baked post. Still not finding what you're looking for? [Browse the archives](/archives). Want to stay up to date? [Subscribe](/subscribe) to Brain Baking! Interested in fleeting thoughts? Read [half-baked notes](/notes).<br/>

View File

@ -2,7 +2,7 @@
import sqlite3
import sys
import os
from datetime import datetime
import datetime
# see https://github.com/arp242/goatcounter/blob/master/db/query/hit_list.List-stats.sql
# date format: "2022-11-01 23:00:00"
@ -13,8 +13,7 @@ select
from hit_counts
where
hit_counts.site = 1
and hour >= "2022-11-01"
and hour < "2022-12-01"
and hour >= ?
and path like '/post/%'
group by path
order by total desc
@ -28,18 +27,20 @@ if len(sys.argv) > 1:
if not os.path.exists(dbpath):
exit("DB file " + dbpath + " does not exist, quitting!")
connection = sqlite3.connect(dbpath)
cursor = connection.cursor()
with sqlite3.connect(dbpath) as connection:
cursor = connection.cursor()
cursor.execute(q)
rows = cursor.fetchall()
total = sum(map(lambda r: int(r[3]), rows))
a_month_ago = (datetime.date.today() - datetime.timedelta(days=31)).strftime("%Y-%m-%d")
title = lambda r: r[1].split('|')[0].strip()
url = lambda r: r[0]
date = lambda r: datetime.strptime(r[2], "%Y-%m-%d %H:%M:%S").strftime("%d %b %Y")
rank = lambda r: str(round((int(r[3]) / total) * 100)) + "%"
cursor.execute(q, [a_month_ago])
rows = cursor.fetchall()
total = sum(map(lambda r: int(r[3]), rows))
print('[')
print(',\n'.join(map(lambda r: "{ \"url\": \"" + url(r) + "\", \"title\": \"" + title(r) + "\", \"rank\": \"" + rank(r) + "\" }", rows)))
print(']')
title = lambda r: r[1].split('|')[0].strip()
url = lambda r: r[0]
date = lambda r: datetime.datetime.strptime(r[2], "%Y-%m-%d %H:%M:%S").strftime("%d %b %Y")
rank = lambda r: str(round((int(r[3]) / total) * 100)) + "%"
print('[')
print(',\n'.join(map(lambda r: "{ \"url\": \"" + url(r) + "\", \"title\": \"" + title(r) + "\", \"rank\": \"" + rank(r) + "\" }", rows)))
print(']')

View File

@ -10,33 +10,35 @@
<div class="txtblock">
<article>
<div class="flexlist">
<div class="flexgrid flexgrid-8020">
<h2>Freshly Baked Thoughts</h2>
<small><a href="/archives">Archives</a> &raquo;</small>
</div>
<ul class="smallist">
<ul class="small">
{{ range first $itms (where .Site.Pages "Section" "post").ByDate.Reverse }}
<li class="flexlist">
<li class="flexgrid flexgrid-8020">
<h3>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h3>
<small>
{{ .Date.Format ("02 Jan 2006") }}
<time datetime='{{ .Date.Format "2006-01-02" }}'>
{{ .Date.Format ("02 Jan 2006") }}
</time>
</small>
</li>
{{ end }}
</ul>
</article>
<article>
<div class="flexlist">
<div class="flexgrid flexgrid-8020">
<h2>Popular Bakings This Month</h2>
<small><a href="https://stats.brainbaking.com">Statistics</a> &raquo;</small>
</div>
<ul class="smallist">
<ul class="small">
{{ range first $itms (.Site.Data.popularposts) }}
<li class="flexlist">
<li class="flexgrid flexgrid-8020">
<h3>
<a href="{{ .url }}">{{ .title }}</a>
</h3>
@ -48,18 +50,20 @@
</ul>
</article>
<article>
<div class="flexlist">
<div class="flexgrid flexgrid-8020">
<h2>Random Tasty Treats</h2>
<small><a href="/post">All posts</a> &raquo;</small>
</div>
<ul class="smallist">
{{ range first $itms (shuffle (where .Site.Pages "Section" "post")) }}
<li class="flexlist">
<ul class="small">
{{ range first $itms (shuffle (where (where .Site.Pages ".Params.disableComments" "!=" "true") "Section" "post")) }}
<li class="flexgrid flexgrid-8020">
<h3>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h3>
<small>
{{ .Date.Format ("02 Jan 2006") }}
<time datetime='{{ .Date.Format "2006-01-02" }}'>
{{ .Date.Format ("02 Jan 2006") }}
</time>
</small>
</li>
{{ end }}
@ -69,7 +73,7 @@
<div class="belowsingle">
<div class="txtblock">
<h2 class="page-header"><a href="/about" alt="go to the about page"><svg class='icon'><title>about me</title><use xlink:href='#about'></use></svg></a>About the Head Brain Baker</h2>
<h2 class="page-header">The Head Brain Baker</h2>
<article class="p-author h-card">
<div class="avatar">
<img class="u-photo" src="{{ .Site.BaseURL }}/img/avatar.jpg" alt="A photo of Me!" />
@ -80,7 +84,6 @@
<p>
If you found my bakings amusing and/or helpful, you can <a rel="me" href="https://ko-fi.com/woutergroeneveld"><strong>buy me a coffee</strong></a>—if you don't mind I'll use it to enjoy a cup of tea instead. I also like to hear about your own <em>bakings</em> via <svg class='icon icon-text'><title>chat icon</title><use xlink:href='#discuss'></use></svg><a rel="me" class="u-url" href="{{ .Site.Author.mastodonlink }}">Mastodon</a> or <svg class='icon icon-text'><title>mail icon</title><use xlink:href='#mail'></use></svg><span class="link meel">e-mail</span>. Thanks!
</p>
<hr/>
</article>
&nbsp;
</div>

View File

@ -2,13 +2,21 @@
Not finding what you're looking for? <a href="/tags">Browse the archives</a>.
<div class="list">
<h2>{{ $year }}</h2>
<h2>{{ $year }}</h2>
{{ range (where (where $.Site.Pages "Section" "post") "Date.Year" "eq" $year).GroupByDate "Jan" }}
<h3><a name="{{ .Key }}"></a>{{ .Key }}</h3>
{{ range (where (where $.Site.Pages "Section" "post") "Date.Year" "eq" $year).GroupByDate "January" }}
<h3>{{ .Key }}</h3>
{{ partial "list-ul" . }}
{{ range .Pages.GroupByDate "Jan" }}
<ul class="small">
{{ range .Pages.ByDate.Reverse }}
<li class="flexgrid flexgrid-8020">
<span><a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
<small>
<time datetime='{{ .Date.Format "2006-01-02" }}'>{{ .Date.Format ("02 Jan 2006") }}</time>
</small>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}

View File

@ -1,17 +1,3 @@
@mixin block-960
width: calc(100% - -220px + 0px)
margin-left: -90px
@mixin block-1120
width: calc(100% - -260px + 0px)
margin-left: -130px
header
@media (min-width: 960px)
@include block-960
@media (min-width: 1120px)
@include block-1120
blockquote
font-family: $font-alt-stack
@ -39,7 +25,6 @@ blockquote
margin-top: -10px
p
padding-left: 0.5rem 0 !important
letter-spacing: 0rem
width: 100%

View File

@ -2,8 +2,13 @@ h1
font-size: 2.4rem
@media (min-width: 768px)
font-size: 3rem
margin-top: 0.5em
margin-bottom: 0.2em
h2
font-size: 2.0rem
font-size: 1.9rem
margin-top: 1em
margin-bottom: 1em
h3
font-size: 1.4rem
h4
@ -11,13 +16,11 @@ h4
h1, h2
font-weight: 700
margin-top: 20px
margin-bottom: 10px
h3, h4, h5, h6
font-weight: normal
margin-top: 10px
margin-bottom: 10px
margin-top: 1em
margin-bottom: 1em
h1, h2, h3, h4, h5, h6
line-height: 1.8

View File

@ -1,11 +1,11 @@
.intro
.intro
padding-top: 0
article
padding-top: 0.8em
h1
margin: 0
padding-bottom: 0.8em
padding-bottom: 1.2em
text-shadow: #bbbbbb 0 4px 5px
font-size: 5vh
@ -38,10 +38,19 @@
height: 30vh
top: 6rem
header
svg.logo
visibility: hidden
@media (min-width: 960px)
width: calc(100vw - 100px)
@media (min-width: 1400px)
visibility: visible
@media (min-width: 1120px)
width: calc(100vw - 420px)
svg.logo
visibility: hidden
position: absolute
left: 0
@media (min-width: 1400px)
visibility: visible

View File

@ -59,29 +59,29 @@ nav, footer
ul
list-style: circle
.flexlist
.flexgrid
display: flex
flex-direction: column
justify-content: space-between
align-items: baseline
small
opacity: 0.7
&-8020
*:nth-child(2)
opacity: 0.7
@media (min-width: 600px)
flex-direction: row
@media (min-width: 600px)
flex-direction: row
*:nth-child(1)
flex: 3 1 15rem
margin: 0.1em
*:nth-child(2)
flex: 1 2 1rem
text-align: right
div, h2, h3
flex: 3 1 15rem
small
flex: 1 2 1rem
text-align: right
ul.smallist
ul.small
padding: 0
list-style: none
div.highlight
padding-top: 1.5rem
padding-bottom: 1.5rem
@ -109,7 +109,7 @@ pre
&.post .content > p:first-of-type::first-letter
margin-top: 10px
article, main.list, main.notes, .txtblock
article, main.notes, .txtblock
margin: auto
flex: 1 0 auto
display: block
@ -122,7 +122,7 @@ article, main.list, main.notes, .txtblock
article
padding-left: 1rem
padding-right: 1rem
margin-bottom: 1rem
padding-bottom: 1rem
text-align: left
&.post .content > p:first-of-type::first-letter
@ -164,13 +164,13 @@ article
.belowsingle
background-color: $belowsingle
border-top: 3px solid $accent
margin-top: 4rem
padding-bottom: 2rem
.page-header
border-bottom: 1px solid $lightgrey
border-bottom: 1px solid darken($lightgrey, 20%)
article hr, main.intro hr
article hr
margin-top: 60px
margin-bottom: 60px
@ -202,19 +202,18 @@ h1, h2, h3
color: $grey
main
min-height: calc(100vh - 112px)
min-height: calc(100vh - 200px)
padding-top: 3rem
padding-bottom: 2rem
footer
padding-top: 2rem
padding-bottom: 2rem
time
color: grey
kbd
color: $accent
border: 1px solid $accent
font-size: 1em
font-size: 0.9em
padding: 2px 4px
border-radius: 3px
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.25)
@ -260,16 +259,13 @@ kbd
background: rgba(0,0,0,0.65) !important
.page-header
margin-top: 60px
.nowrap
white-space: nowrap
table
width: 100%
padding-top: 1rem
padding-bottom: 1rem
margin-top: 1rem
margin-bottom: 1rem
border-collapse: collapse
tbody

View File

@ -1,48 +0,0 @@
div.list
text-align: left
padding-left: 2rem
padding-bottom: 2rem
h2
border-top: 1px solid #eee
padding-top: 1rem
h3
color: #999
@media (min-width: 768px)
float: left
margin-top: 1.5rem
.list-ul
list-style: none
margin: 0
padding: 0
padding-bottom: 1rem
@media (min-width: 768px)
padding-left: 4rem
li
padding: 0.8rem
.list-date
font-weight: normal
padding-left: 0.4rem
padding-right: 0.4rem
color: white
background-color: $accent
border-radius: 2rem
margin-top: 1.5rem
float: left
div
margin-left: 60px
.pages
padding: 15px 0
.pages-icon
padding: 0 15px
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover
border-color: $accent !important

View File

@ -19,7 +19,6 @@ $accent: #018661
@import 'figures'
@import 'icons'
@import 'blockquote'
@import 'listing'
@import 'goodreads'
@import 'forms'
@import 'toot'

View File

@ -1,50 +1,38 @@
{{ partial "header" . }}
{{ partial "bigimg" . }}
<a id="top"></a>
<main class="list">
{{ if .Title }}
<header>
<h1>
<svg class='icon'><use xlink:href="#{{ .Params.icontag }}"></use></svg>&nbsp;{{ .Title }}
</h1>
{{ if isset .Params "subtitle" }}
<h2>{{ .Params.subtitle }}</h2>
{{ end }}
</header>
{{ end }}
<hr/>
<main class="list h-entry">
<header>
<h1 class="p-name" id="header">
<svg class='icon'><use xlink:href="#{{ .Params.icontag }}"></use></svg>&nbsp;{{ .Title }}
</h1>
</header>
<article>
{{ .Content }}
</article>
<article>
<small>
<small>
{{ range .Pages.GroupByDate "2006" "desc" }}
{{ if ne .Key "0001" }}
<h2>{{ .Key }}</h2>
<h2>{{ .Key }}</h2>
{{ range .Pages.GroupByDate "Jan" }}
<ul class="smallist">
{{ range .Pages.ByDate.Reverse }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<span style="color: gray;">{{ .Date.Format ("02 Jan") }}</span>
</li>
{{ end }}
</ul>
<ul class="small">
{{ range .Pages.ByDate.Reverse }}
<li class="flexgrid flexgrid-8020">
<span><a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
<small>
<time datetime='{{ .Date.Format "2006-01-02" }}'>{{ .Date.Format ("02 Jan 2006") }}</time>
</small>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ end }}
</small>
</small>
</article>
<footer>
</footer>
</main>
{{ partial "footer" . }}

View File

@ -1,30 +1,36 @@
{{ partial "header" . }}
<main class="h-entry">
{{ partial "bigimg" . }}
<article class="single {{ .Section }}" data-pagefind-body>
<main class="h-entry" data-pagefind-body>
{{ partial "single-header" . }}
<article class="single {{ .Section }}">
<div class="e-content content">
{{ .Content | safeHTML }}
{{ if isset $.Params "tags" }}
<p>
<svg class='icon icon-text' width='24' height='24'>
<title>tags icon</title>
<use xlink:href='#tag'></use>
</svg>
<span class='list-tags'>
{{ range .Params.tags }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}" title="Tag: {{ . }}"><kbd class="item-tag p-category">{{ . }}</kbd></a>
{{ end }}
</span>
</p>
{{ end }}
</div>
</article>
</main>
{{ if (not .Params.disableComments) }}
<div class="belowsingle">
<div class="txtblock">
{{ partial "single-comments" . }}
{{ partial "single-webmentions" . }}
{{ partial "single-related" . }}
<footer>
</footer>
{{ partial "single-webmentions" . }}
{{ partial "single-comments" . }}
</div>
</div>
{{ else }}
<footer>
</footer>
{{ end }}
</main>

View File

@ -1,24 +1,32 @@
{{ partial "header" . }}
<main class="list">
<header>
<h1 class="p-name" id="header">
<svg class='icon'><use xlink:href='#tag'></use></svg>{{ .Section | humanize }} <em>"{{ .Title }}"</em>
</h1>
</header>
<h2>
<svg class='icon'><use xlink:href='#tag'></use></svg>Tagged with: <br/>"{{ .Title }}"
</h2>
<div class="list">
{{ range .Paginator.Pages.GroupByDate "2006" "desc" }}
<article>
{{ range .Pages.GroupByDate "2006" "desc" }}
{{ if ne .Key "0001" }}
<h2>{{ .Key }}</h2>
{{ range .Pages.GroupByDate "Jan" }}
<h3>{{ .Key }}</h3>
{{ partial "list-ul" . }}
{{ end }}
{{ end }}
</div>
{{ template "_internal/pagination.html" . }}
{{ range .Pages.GroupByDate "Jan" }}
<ul class="small">
{{ range .Pages.ByDate.Reverse }}
<li class="flexgrid flexgrid-8020">
<span><a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
<small>
<time datetime='{{ .Date.Format "2006-01-02" }}'>{{ .Date.Format ("02 Jan 2006") }}</time>
</small>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ end }}
</article>
</main>
{{ partial "footer" . }}

View File

@ -1,8 +1,6 @@
{{ $.Scratch.Set "curLetter" "" }}
{{ $offset := 1 }}
{{ partial "header" . }}
{{ partial "bigimg" . }}
<a id="top"></a>
<main class="list">
@ -12,8 +10,6 @@
</h1>
</header>
<hr/>
{{ with .Content }}
<article>
{{ . }}

View File

@ -1,6 +1,4 @@
{{ partial "header" . }}
{{ partial "bigimg" . }}
<a id="top"></a>
<main class="list">

View File

@ -1,7 +1,4 @@
{{ partial "header" . }}
{{ partial "bigimg" . }}
<main class="h-entry">
<article class="single {{ .Section }}">
<a id="top"></a>

View File

@ -1,18 +0,0 @@
{{ if .Params.bigimg }}
{{- $image := resources.Get (printf "%s%s" "bigimg/" .Params.bigimg ) -}}
{{ if eq $image nil }}
<div style="padding-top: 3rem">
</div>
{{ else }}
<!-- jumbotron big-img see head-meta.html -->
<div class="jumbotron big-img">
<div class="container">
&nbsp;
</div>
</div>
{{ end }}
{{ else }}
<div style="padding-top: 3rem">
</div>
{{ end }}

View File

@ -38,41 +38,13 @@
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
{{ $thumb := $logo | absURL }}
{{ if .Params.bigimg }}
{{- $image := resources.Get (printf "%s%s" "bigimg/" .Params.bigimg ) -}}
{{ if eq $image nil }}
{{ $match := findRE `!\[(.*)\]\((.+).(jpg|png|gif)` .RawContent 1 }}
{{ range $match }}
{{ $relthumb := replaceRE `!\[(.*)\]\(` "" . }}
{{ if hasPrefix $relthumb "/" }}
{{ $thumb = printf "%s%s" $base $relthumb }}
{{ else }}
{{- $imgsmall := $image.Resize "768x jpg q70" }}
{{ $thumb = $imgsmall.Permalink }}
{{- $imgmedium := $image.Resize "960x jpg q85" }}
<meta property="og:image:width" content="{{ $imgsmall.Width }}" />
<meta property="og:image:height" content="{{ $imgsmall.Height }}" />
<style>
.big-img {
background-image: url({{ $imgsmall.RelPermalink }}) !important;
}
@media (min-width: 768px) {
.big-img {
background-image: url({{ $imgmedium.RelPermalink }}) !important;
}
}
@media (min-width: 960px) {
.big-img {
background-image: url({{ $image.RelPermalink }}) !important;
}
}
</style>
{{ end }}
{{ else }}
{{ $match := findRE `!\[(.*)\]\((.+).(jpg|png|gif)` .RawContent 1 }}
{{ range $match }}
{{ $relthumb := replaceRE `!\[(.*)\]\(` "" . }}
{{ if hasPrefix $relthumb "/" }}
{{ $thumb = printf "%s%s" $base $relthumb }}
{{ else }}
{{ $thumb = printf "%s%s" $perm $relthumb }}
{{ end }}
{{ $thumb = printf "%s%s" $perm $relthumb }}
{{ end }}
{{ end }}
<meta name="twitter:image" property="og:image" content="{{ $thumb }}" />

View File

@ -1,34 +0,0 @@
<article>
<ul class="list-ul">
{{ range .Pages.ByDate.Reverse }}
<li>
<span class="list-date">{{ .Date.Format ("02") }}</span>
<div class="list-title">
<h4>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h4>
{{ if isset .Params "subtitle" }}
{{ .Params.subtitle }}
{{ else }}
{{ .Summary | truncate 50 }}
{{ end }}
</div>
<div class="list-tags">
{{ if isset .Params "categories" }}
<svg class='icon icon-text icon-gray'><use xlink:href="#folder"></use></svg>
{{ range .Params.categories }}
<a href="{{ site.BaseURL }}categories/{{ . | urlize }}">{{ . }}</a>
{{ end }}
&nbsp;
{{ end }}
{{ if isset .Params "tags" }}
<svg class='icon icon-text icon-gray'><use xlink:href="#tag"></use></svg>&nbsp;
{{ range .Params.tags }}
<a href="{{ site.BaseURL }}tags/{{ . | urlize }}"><kbd class="item-tag">{{ . }}</kbd></a>
{{ end }}
{{ end }}
</div>
</li>
{{ end }}
</ul>
</article>

View File

@ -1,13 +1,15 @@
<article class="p-author h-card">
<h4 class="page-header">
<h3 class="page-header" id="bio">
<a href="#bio">
<svg class='icon icon-text' width='24' height='24'>
<title>About icon</title>
<use xlink:href='#about'></use>
</svg>
Bio and Support
</h4>
</a>
Bio and Support
</h3>
<article class="p-author h-card">
<div class="avatar">
<a href="{{ .Site.BaseURL }}" rel="me" class="u-url">
<img class="u-photo" loading="lazy" src="{{ .Site.BaseURL }}img/avatar.jpg" alt="A photo of Me!" />

View File

@ -1,9 +1,8 @@
<header>
{{ if .Title }}
{{ if (not .Params.disableComments) }}
<a href="/">
<svg class="logo" style="position: absolute; left: 2rem;"><title>Brain Baking home</title><use xlink:href='#logo'></use></svg>
<svg class="logo"><title>Brain Baking home</title><use xlink:href='#logo'></use></svg>
</a>
{{ end }}
<h1 class="p-name" id="header">
@ -13,55 +12,37 @@
{{ .Title }}
</h1>
{{ end }}
{{ if isset .Params "subtitle" }}
<h2 class="p-summary">{{ .Params.subtitle }}</h2>
{{ end }}
{{ if isset .Params "date" }}
<h3>
{{ if isset .Params "date" }}
<svg class='icon icon-text' width='24' height='24'>
<title>published icon</title>
<use xlink:href='#cal1'></use>
</svg>
<time datetime='{{ .Date.Format "2006-01-02" }}' class="dt-published">
<a class="u-url u-uid" href="{{ .RelPermalink }}">
{{ .Date.Format (.Site.Params.dateFormat | default "2 January 2006") }}
</a>
</time>
{{ end }}
{{ if isset .Params "categories" }}
&nbsp;|&nbsp;
<span title="Categories">
<svg class='icon icon-text' width='24' height='24'>
<title>category icon</title>
<use xlink:href='#folder'></use>
</svg>
{{ range .Params.categories }}
<a class="p-category" href="/categories/{{ . }}">{{ . }}</a>
{{ end }}
</span>
{{ end }}
{{ if (and (isset .Params "context") (not (eq .Params.context ""))) }}
&nbsp;|&nbsp;
<svg class='icon icon-text' width='24' height='24'>
<use xlink:href='#discuss'></use>
</svg>
<a href="{{ .Params.context }}" class="u-in-reply-to">In reply to</a>{{ with .Params.rsvp }}&nbsp;(RSVP: <span class="p-rsvp">{{ . }}</span>){{ end }}<br/>
{{ end }}
</h3>
{{ end }}
{{ if isset $.Params "tags" }}
<svg class='icon icon-text' width='24' height='24'>
<title>tags icon</title>
<use xlink:href='#tag'></use>
{{ if isset .Params "date" }}
<svg class='icon icon-text' width='24' height='24'>
<title>published icon</title>
<use xlink:href='#cal1'></use>
</svg>
{{ end }}
<span class='list-tags'>
{{ range .Params.tags }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}"><kbd class="item-tag p-category">{{ . }}</kbd></a>
<time datetime='{{ .Date.Format "2006-01-02" }}' class="dt-published">
<a class="u-url u-uid" href="{{ .RelPermalink }}">
{{ .Date.Format (.Site.Params.dateFormat | default "2 January 2006") }}
</a>
</time>
{{ end }}
</span>
{{ if isset .Params "categories" }}
&nbsp;|&nbsp;
<span title="Categories">
<svg class='icon icon-text' width='24' height='24'>
<title>category icon</title>
<use xlink:href='#folder'></use>
</svg>
{{ range .Params.categories }}
<a class="p-category" href="/categories/{{ . }}">{{ . }}</a>
{{ end }}
</span>
{{ end }}
{{ if (and (isset .Params "context") (not (eq .Params.context ""))) }}
&nbsp;|&nbsp;
<svg class='icon icon-text' width='24' height='24'>
<use xlink:href='#discuss'></use>
</svg>
<a href="{{ .Params.context }}" class="u-in-reply-to">In reply to</a>{{ with .Params.rsvp }}&nbsp;(RSVP: <span class="p-rsvp">{{ . }}</span>){{ end }}<br/>
{{ end }}
{{ end }}
</header>

View File

@ -1,32 +1,53 @@
{{ $related := first 3 (where (where .Site.RegularPages.ByDate.Reverse ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ $currtitle := .Title }}
{{ $currRellink := substr .RelPermalink 0 -1 }}
{{ $currContent := .Content }}
{{ $backlinks := slice }}
{{ $forwardlinks := slice }}
{{ range (where (where .Site.Pages.ByDate.Reverse ".Section" "in" (slice "post")) ".Params.disableComments" "!=" "true") }}
{{ $found := findRE $currRellink .Content 1 }}
{{ if and ($found) (ne .Title $currtitle) }}
{{ $backlinks = $backlinks | append . }}
{{ else }}
{{ $rellink := substr .RelPermalink 0 -1 }}
{{ $found = findRE $rellink $currContent 1 }}
{{ if and ($found) (ne .Title $currtitle) }}
{{ $forwardlinks = $forwardlinks | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ $tagslice := first 5 (where (where .Site.RegularPages.ByDate.Reverse ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ $related := append $tagslice $forwardlinks }}
{{ $related = append $related $backlinks }}
{{ if $related }}
<h4 class="page-header" id="related">
<a href="#related">
<h3 class="page-header" id="related">
<a href="#related">
<svg class='icon icon-text' width='24' height='24'>
<title>Related articles</title>
<use xlink:href='#news'></use>
</svg>
</a>
Related Articles
</h4>
</a>
You Might Also Like...
</h3>
{{ range $related }}
<article>
<h4><a href="{{ .RelPermalink }}">{{ .Title }}</a></h4>
<time datetime='{{ .Date.Format "2006-01-02" }}'>
<svg class='icon icon-text' width='24' height='24'>
<use xlink:href='#cal1'></use>
</svg>
{{ .Date.Format (.Site.Params.dateFormat | default "02 Jan 2006") }}
</time>&nbsp;|&nbsp;
{{ if isset .Params "subtitle" }}
{{ .Params.subtitle }}
{{ else }}
{{ .Summary | truncate 50 }}
{{ end }}
</article>
{{ end }}
<hr/>
<article>
<ul class="small">
{{ range first 7 $related | uniq }}
<li class="flexgrid flexgrid-8020" style="padding-bottom: 0.5rem">
<span>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</span>
<small>
<time datetime='{{ .Date.Format "2006-01-02" }}'>
{{ .Date.Format (.Site.Params.dateFormat | default "02 Jan 2006") }}
</time>
</small>
</li>
{{ end }}
</ul>
</article>
{{ end }}

View File

@ -2,7 +2,7 @@
{{ $wmServer := .Site.Params.webmentionServer }}
{{ if $mentions }}
<h4 class="page-header" id="mentions">
<h3 class="page-header" id="mentions">
<a href="#mentions">
<svg class='icon icon-text' width='24' height='24'>
<title>Discussion</title>
@ -10,7 +10,7 @@
</svg>
</a>
Mentions and Replies
</h4>
</h3>
<div class="tootlist" style="margin-bottom: -3rem">
{{ range $mentions }}

View File

@ -1,6 +1,4 @@
{{ partial "header" . }}
{{ partial "bigimg" . }}
<a id="top"></a>
<main class="list">
@ -10,7 +8,6 @@
</h1>
</header>
<hr/>
{{ with .Content }}
<article>
{{ . }}
@ -19,24 +16,23 @@
<article>
<h2>Prose in Words</h2>
<div class="worksgrid">
{{ range (where .Pages "Params.type" "writing") }}
{{ partial "works-block.html" . }}
{{ end }}
</div>
</article>
<div class="worksgrid">
{{ range (where .Pages "Params.type" "writing") }}
{{ partial "works-block.html" . }}
{{ end }}
</div>
<article>
<h2>Prose in Code</h2>
For those interested in smaller but technical buns of baked goodness, have fun exploring my open source projects at <a href="https://git.brainbaking.com/">https://git.brainbaking.com/</a> or my contributions at <a href="{{ .Site.Author.githublink }}">GitHub</a>.
<div class="worksgrid">
{{ range (where .Pages "Params.type" "code") }}
{{ partial "works-block.html" . }}
{{ end }}
</div>
</article>
<div class="worksgrid">
{{ range (where .Pages "Params.type" "code") }}
{{ partial "works-block.html" . }}
{{ end }}
</div>
<footer>
</footer>
</main>
{{ partial "footer" . }}