~bfiedler/website

8f02fd341a52acb5a5563e3e5a47805deeaaa22b — Ben Fiedler 1 year, 11 months ago 32b7577
Add some custom things to chess games

* Chess games can now have a tournament and games can be searched per
  tournament
* URLs for chess games do not contain the date (aliases for existing
  games are provided)
14 files changed, 83 insertions(+), 16 deletions(-)

M assets/style.scss
M config.yaml
R content/chess/{first-rated-game.md => smm-2022-01.md}
M content/chess/smm-2022-02.md
M content/chess/test.md
M layouts/_default/single.html
A layouts/blog/meta.html
A layouts/chess/li-no-tournament.html
M layouts/chess/li.html
A layouts/chess/meta.html
R layouts/{taxonomy/taxonomy.html => tags/list.html}
R layouts/{term/term.html => tags/term.html}
A layouts/tournaments/list.html
A layouts/tournaments/term.html
M assets/style.scss => assets/style.scss +13 -0
@@ 361,6 361,19 @@ ul.nav {
    }
}

.tournament-list {
    margin: 0;
    padding: 0;
    padding-left: 2em;

    list-style-type: circle;

    li {
        margin: 0;
        padding: 0;
    }
}

.content > footer {
    grid-row: 4 / 5;
    grid-column: 1 / 3;

M config.yaml => config.yaml +2 -1
@@ 14,10 14,11 @@ pygmentsUseClasses: true

taxonomies:
  tag: tags
  tournament: tournaments

permalinks:
  blog: "/blog/:year/:month/:day/:filename"
  chess: "/chess/:year/:month/:day/:filename"
  chess: "/chess/:filename"

outputs:
  home: ["HTML"]

R content/chess/first-rated-game.md => content/chess/smm-2022-01.md +5 -2
@@ 1,10 1,13 @@
---
author: "Ben Fiedler"
title: "My first officially rated chess game"
title: "My first rated chess game"
date: "2022-04-30"
tournament: "SMM 2022"
tournaments: "SMM 2022"
color: "white"
result: "1-0"
aliases:
  - "/chess/2022/04/30/first-rated-game/"
  - "/chess/2022/05/06/first-rated-game/"
---

I first played chess with my father when I was a child, and I also remember

M content/chess/smm-2022-02.md => content/chess/smm-2022-02.md +4 -2
@@ 1,10 1,12 @@
---
author: "Ben Fiedler"
title: "SMM 2022 - 2nd round"
title: "2nd Round"
date: "2022-05-14"
tournament: "SMM 2022"
tournaments: "SMM 2022"
color: "white"
result: "1-0"
aliases:
  - "/chess/2022/05/14/smm-2022-02/"
---

My second game for [SC Réti](https://screti.ch) in the 2022 SMM was played

M content/chess/test.md => content/chess/test.md +1 -1
@@ 1,6 1,6 @@
---
title: "Test game (drawn)"
date: "2022-05-05"
date: "2022-01-01"
color: "black"
result: "½-½"
draft: true

M layouts/_default/single.html => layouts/_default/single.html +1 -10
@@ 4,16 4,7 @@
    <article>
        <header>
            <h1 class="article-title">{{ .Title }}</h1>
            <aside class="article-metadata">
                <time class="time" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2006-01-02" }}</time>
                on <a href="{{ .Section | relURL }}">this blog</a>
                {{ partial "feed-icon.html" .Section }}
            </aside>
            {{- with .Params.Tags -}}
            <aside class="article-metadata-small">tags:<ul class="tags">
                {{- range . }}<li><a href="/tags/{{ . }}">{{ . }}</a></li>{{- end }}</ul>
            </aside>
            {{- end }}
            {{ .Render "meta" }}
        </header>
        {{ $content := .Content }}
        {{- if in .Params.tags "math" }}

A layouts/blog/meta.html => layouts/blog/meta.html +10 -0
@@ 0,0 1,10 @@
<aside class="article-metadata">
  <time class="time" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2006-01-02" }}</time>
  on <a href="{{ .Section | relURL }}">this blog</a>
  {{ partial "feed-icon.html" .Section }}
</aside>
{{- with .Params.Tags -}}
<aside class="article-metadata-small">tags:<ul class="tags">
    {{- range . }}<li><a href="/tags/{{ . }}">{{ . }}</a></li>{{- end }}</ul>
</aside>
{{- end }}

A layouts/chess/li-no-tournament.html => layouts/chess/li-no-tournament.html +10 -0
@@ 0,0 1,10 @@
<li>
    <article>
        <header>
            <time class="chess-time" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2006-01-02" }}</time>
            <aside class="color color-{{ .Params.Color }}"></aside>
            <aside class="result">{{ .Params.Result }}</aside>
            <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
        </header>
    </article>
</li>

M layouts/chess/li.html => layouts/chess/li.html +4 -0
@@ 4,7 4,11 @@
            <time class="chess-time" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2006-01-02" }}</time>
            <aside class="color color-{{ .Params.Color }}"></aside>
            <aside class="result">{{ .Params.Result }}</aside>
            {{ if .Params.Tournaments }}
            <h1><a href="{{ .RelPermalink }}">{{ .Params.Tournaments }} - {{ .Title }}</a></h1>
            {{ else }}
            <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
            {{ end }}
        </header>
    </article>
</li>

A layouts/chess/meta.html => layouts/chess/meta.html +7 -0
@@ 0,0 1,7 @@
<aside class="article-metadata">
  <span>played on </span><time class="time" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2006-01-02" }}</time>
  <span>with</span><aside class="color color-{{ .Params.Color }}"></aside>

  in <a href="/tournaments/{{ .Params.Tournaments | urlize }}">{{ .Params.Tournaments }}</a>
  {{ partial "feed-icon.html" .Section }}
</aside>

R layouts/taxonomy/taxonomy.html => layouts/tags/list.html +0 -0
R layouts/term/term.html => layouts/tags/term.html +0 -0
A layouts/tournaments/list.html => layouts/tournaments/list.html +14 -0
@@ 0,0 1,14 @@
{{ define "title" }}Chess Tournaments{{ end }}
{{ define "main" }}
{{ partial "header.html" (dict "context" . "IsDetailed" true "DisplayImage" true) }}
<main>
    <h1 class="list-title">{{ block "title" . }}{{ end }}</h1>
    <p>Below you can find a list of chess tournaments that the games I show are from.</p>
    <ol class="tournament-list">
        {{- range .Data.Terms.Alphabetical -}}
        <li><a href="/tournaments/{{ .Name | urlize }}">{{ .Page.Title }}</a></li>
        {{- end -}}
    </ol>
</main>
{{ partial "footer.html" }}
{{ end }}

A layouts/tournaments/term.html => layouts/tournaments/term.html +12 -0
@@ 0,0 1,12 @@
{{ define "main" }}
{{ partial "header.html" (dict "context" . "IsDetailed" true "DisplayImage" true) }}
<main>
    <h1 class="list-title">{{ block "title" . }}{{ end }}</h1>
    <ol class="article-list">
      {{- range .Pages.ByPublishDate.Reverse }}
      {{ .Render "li-no-tournament" }}
      {{- end }}
    </ol>
</main>
{{ partial "footer.html" }}
{{ end }}