From 1dcbe54995dc7bbc719271d84f13a718d23a295a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 7 May 2017 18:43:04 +0100 Subject: [PATCH] Store number of links in config --- config.yml | 2 ++ layouts/index.html | 4 ++-- layouts/partials/navbar.html | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 97e849f..1cb1e01 100644 --- a/config.yml +++ b/config.yml @@ -6,6 +6,8 @@ params: author: TheOrangeOne author_name: Jake Howard summary_length: 100 + nav_items: 5 + index_items: 6 staticDir: "static/build" diff --git a/layouts/index.html b/layouts/index.html index 29f7803..6df0be7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -43,7 +43,7 @@

Projects

- {{ 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 }}
@@ -53,7 +53,7 @@

Recent Posts

- {{ range first 6 (where .Data.Pages.ByDate "Section" "!=" "") }} + {{ range first .Site.Params.index_items (where .Data.Pages.ByDate "Section" "!=" "") }} {{ partial "box.html" . }} {{ end }}
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index f040358..842cb51 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -7,10 +7,10 @@ {{ .LinkTitle }} {{ if .Pages }}
    - {{ range first 4 .Pages.ByDate }} + {{ range first .Site.Params.nav_items .Pages.ByDate }}
  • {{ .LinkTitle }}
  • {{ end }} - {{ if ge (len .Pages) 4 }} + {{ if ge (len .Pages) .Site.Params.nav_items }}
  • See more
  • {{ end }}