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)
This commit is contained in:
parent
f753261345
commit
5d283cd3a9
|
@ -17,14 +17,7 @@
|
||||||
<section class="list-item">
|
<section class="list-item">
|
||||||
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
|
<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>
|
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
|
||||||
<br><div class="description">
|
<br>{{ template "partials/pagedescription.html" . }}
|
||||||
{{ if isset .Params "description" }}
|
|
||||||
{{ .Description }}
|
|
||||||
{{ else }}
|
|
||||||
{{ .Summary }}…
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
|
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ template "partials/paginator.html" . }}
|
{{ template "partials/paginator.html" . }}
|
||||||
|
|
7
layouts/partials/pagedescription.html
Normal file
7
layouts/partials/pagedescription.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="description">
|
||||||
|
{{ if isset .Params "description" }}
|
||||||
|
{{ .Description }}
|
||||||
|
{{ else }}
|
||||||
|
{{ .Summary }}…
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
Loading…
Reference in a new issue