Store number of links in config
This commit is contained in:
parent
2b10f74461
commit
1dcbe54995
3 changed files with 6 additions and 4 deletions
|
@ -6,6 +6,8 @@ params:
|
|||
author: TheOrangeOne
|
||||
author_name: Jake Howard
|
||||
summary_length: 100
|
||||
nav_items: 5
|
||||
index_items: 6
|
||||
|
||||
staticDir: "static/build"
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<div class="box special">
|
||||
<h2>Projects</h2>
|
||||
<div class="row">
|
||||
{{ range first 6 (where .Data.Pages.ByDate "Section" "projects") }}
|
||||
{{ range first .Site.Params.index_items (where .Data.Pages.ByDate "Section" "projects") }}
|
||||
{{ partial "box.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<div class="box special">
|
||||
<h2>Recent Posts</h2>
|
||||
<div class="row">
|
||||
{{ range first 6 (where .Data.Pages.ByDate "Section" "!=" "") }}
|
||||
{{ range first .Site.Params.index_items (where .Data.Pages.ByDate "Section" "!=" "") }}
|
||||
{{ partial "box.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
{{ if .Pages }}
|
||||
<ul>
|
||||
{{ range first 4 .Pages.ByDate }}
|
||||
{{ range first .Site.Params.nav_items .Pages.ByDate }}
|
||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{ end }}
|
||||
{{ if ge (len .Pages) 4 }}
|
||||
{{ if ge (len .Pages) .Site.Params.nav_items }}
|
||||
<li><a href="{{ .Permalink }}"><i>See more</i></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue