all repos — archie @ 5d283cd3a9d69d8ff3537d6fddb14e607f785d89

A minimal Hugo Theme

Break out the page description from the 'index.html' layout into its own partial - this adds the ability for a site to customize the description on the main page without altering the theme. (#71)

James Montgomerie 68861+th-in-gs@users.noreply.github.com
Sun, 27 Nov 2022 03:59:33 -0800
commit

5d283cd3a9d69d8ff3537d6fddb14e607f785d89

parent

f753261345802be51979dde243f5693c3bd48e85

2 files changed, 8 insertions(+), 8 deletions(-)

jump to
M layouts/index.htmllayouts/index.html

@@ -17,14 +17,7 @@ {{ range $paginator.Pages }}

<section class="list-item"> <h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1> <time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time> - <br><div class="description"> - {{ if isset .Params "description" }} - {{ .Description }} - {{ else }} - {{ .Summary }}&hellip; - {{ end }} - </div> - <a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a> + <br>{{ template "partials/pagedescription.html" . }} </section> {{ end }} {{ template "partials/paginator.html" . }}
A layouts/partials/pagedescription.html

@@ -0,0 +1,7 @@

+<div class="description"> + {{ if isset .Params "description" }} + {{ .Description }} + {{ else }} + {{ .Summary }}&hellip; + {{ end }} +</div>