mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
09.55.2025 3fc0dba4012108749f433da017d9e02cf64b6503
theme(fix): add author bylines and fix author generation

closes #623

Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
1 files added
5 files modified
16 ■■■■■ changed files
exampleSite/config.toml 2 ●●● patch | view | raw | blame | history
exampleSite/content/en/post/chapter-6.md 1 ●●●● patch | view | raw | blame | history
layouts/_default/single.html 3 ●●●● patch | view | raw | blame | history
layouts/_default/summary-with-image.html 5 ●●●●● patch | view | raw | blame | history
layouts/partials/author.html patch | view | raw | blame | history
layouts/partials/summary-with-image.html 5 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml
@@ -33,7 +33,7 @@
[params]
text_color = ""
author = ""
author = "Victor Hugo" # default author, override via `author` in a posts front matter
favicon = ""
site_logo = ""
description = "The last theme you'll ever need. Maybe."
exampleSite/content/en/post/chapter-6.md
@@ -4,6 +4,7 @@
featured_image: "/images/esmeralda.jpg"
tags: []
title: "Chapter VI: Esmeralda"
author: "Victor Hugo"
---
We are delighted to be able to inform the reader, that during the whole of
this scene, Gringoire and his piece had stood firm. His actors, spurred on
layouts/_default/single.html
@@ -4,6 +4,7 @@
{{ end }}
{{ define "main" }}
  {{ $page := .}}
  {{ $section := .Site.GetPage "section" .Section }}
  <article class="flex-l flex-wrap justify-between mw8 center ph3">
    <header class="mt4 w-100">
@@ -20,7 +21,7 @@
      </h1>
      {{ with .Params.author | default .Site.Params.author }}
      <p class="tracked">
        {{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}}
        {{- if eq $page.Language "de" "en" "es" "fr" "it" "no" "pt" -}}
          {{- i18n "by" -}}
        {{ end -}} <strong>
        {{- if reflect.IsSlice . -}}
layouts/_default/summary-with-image.html
@@ -19,9 +19,10 @@
        <div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
          {{ .Summary }}
        </div>
        {{ with .Params.author | default .Site.Params.author }}
          <p class="f6 lh-copy mv0">By {{ . }}</p>
        {{- end -}}
          <a href="{{.RelPermalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
        {{/* TODO: add author
        <p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
      </div>
    </div>
  </div>
layouts/partials/author.html
layouts/partials/summary-with-image.html
@@ -22,9 +22,10 @@
        <div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
          {{ .Summary }}
        </div>
        {{ with .Params.author | default .Site.Params.author }}
          <p class="f6 lh-copy mv0">By {{ . }}</p>
        {{- end -}}
          <a href="{{.RelPermalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
        {{/* TODO: add author
        <p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
      </div>
    </div>
  </div>