Add both first and last classes when only one page
This commit is contained in:
parent
6388e9e916
commit
804c44f37d
|
@ -21,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{ range $index_val, $elem_val := $sections }}
|
{{ range $index_val, $elem_val := $sections }}
|
||||||
<div class='post-holder'>
|
<div class='post-holder'>
|
||||||
<article id='{{ anchorize .Title }}' class='post {{ if eq $index_val 0 }}first{{ else }}{{ if eq (add $index_val 1) (len $sections) }}last{{ end }}{{ end }}'>
|
<article id='{{ anchorize .Title }}' class='post {{ if eq $index_val 0 }}first{{ end }} {{ if eq (add $index_val 1) (len $sections) }}last{{ end }}'>
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
<h2 class="post-title">{{ .Title }}</h2>
|
<h2 class="post-title">{{ .Title }}</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
Loading…
Reference in a new issue