Continue Reading permalink code in Bothy theme

I would like to add a permalink for ‘Continue Reading’ for my long-form posts, in the Bothy Theme. I tried myself, but I failed… I believe this code should be in layouts/_default/list.html. I added the code myself with AI’s help (Perplexity), but it was giving me an error, something about {{else}} or {{end}}. I am a newbie here. I restored it until I get the code properly. If anyone can help me provide the code to add to the HTML page.

So, please help!

{{ define "main" }}

<main class="h-feed">
<header class="category-header">
<h2>{{ .Title | safeHTML }}</h2>
{{- with .Content }} {{ . | safeHTML }} {{- end }}
</header>

{{ $paginator := .Paginate (where .Site.Pages.ByDate.Reverse "Type" "post") }} {{ range
$paginator.Pages }}
<article class="h-entry post">
<header class="post-header">
<a href="{{ .Permalink }}" class="u-url">
<time datetime='{{ .Date.Format "2006-01-02" }}' class="dt-published post-date">
{{ .Date.Format (default "January 2, 2006" .Site.Params.dateFormat) }}
</time>
</a>
{{ if .Title }}
<h2>
<a href="{{ .Permalink }}" class="p-name">{{ .Title }}</a>
</h2>
{{ end }}
</header>

{{ if .Params.custom_summary }}
<div class="p-summary">
<p>{{ .Summary | safeHTML }}</p>
</div>
{{ else }}
<div class="p-summary">
{{ .Summary }}
</div>
{{ end }}

{{ if .Truncated }}
<p><em><a href="{{ .Permalink }}">Continue reading →</a></em></p>
{{ end }}
{{ else }}

{{ else }}
<div class="e-content with-title">{{ .Content }}</div>
{{ end }} {{ partial "categories.html" . }}
</article>
{{ end }} {{ partial "pagination.html" $paginator }}
</main>

{{ end }}

Thank you,

Toby

I finally got it fixed. I had to fix three HTML pages below, with Perplexity’s help!

  • layouts/index.html
  • layouts/_default/list.html
  • layouts/categories/list.html