diff options
author | Curtis Timson <curt@live.co.uk> | 2018-02-11 18:13:02 +0300 |
---|---|---|
committer | Curtis Timson <curt@live.co.uk> | 2018-02-11 18:13:02 +0300 |
commit | 7dcd17fda0279b114c5687d3ad3a011225972fa9 (patch) | |
tree | 08bffdad968ad56c7fb3436d70e75e7b3dae0f28 | |
parent | 5652c8ecaca47577b406cf733ad37e21d6d76d80 (diff) |
:wrench: Make blog title configurable
-rw-r--r-- | exampleSite/config-prod.toml | 4 | ||||
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/_default/list.html | 14 | ||||
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/partials/blog.html | 2 | ||||
-rw-r--r-- | layouts/partials/nav.html | 2 |
6 files changed, 16 insertions, 11 deletions
diff --git a/exampleSite/config-prod.toml b/exampleSite/config-prod.toml index dc8ef03..d78af1f 100644 --- a/exampleSite/config-prod.toml +++ b/exampleSite/config-prod.toml @@ -39,6 +39,10 @@ theme = "../.." title5 = "Vitae tempor lorem" +[params.blog] + title = "The Blog" + postsperpage = "6" + [params.social] facebook = "https://facebook.com" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 09694bf..eda6882 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -40,7 +40,8 @@ theme = "../.." title5 = "Vitae tempor lorem" [params.blog] - postsperpage = "4" + title = "The Blog" + postsperpage = "6" [params.social] facebook = "https://facebook.com" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bb2109b..cfd7d12 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -25,16 +25,16 @@ <div class="container"> {{ $paginator := .Paginate (where .Data.Pages "Type" "blog") .Site.Params.Blog.postsperpage }} - {{ partial "blog.html" (dict "context" . "paginator" $paginator) }} + {{ partial "blog.html" (dict "title" .Site.Params.Blog.title "paginator" $paginator) }} <footer> <ul class="actions"> - {{ if $paginator.HasPrev }} - <li><a href="{{ $paginator.Prev.URL }}" class="button big">Prev</a></li> - {{ end }} - {{ if $paginator.HasNext }} - <li><a href="{{ $paginator.Next.URL }}" class="button alt big">Next</a></li> - {{ end }} + {{ if $paginator.HasPrev }} + <li><a href="{{ $paginator.Prev.URL }}" class="button big">Prev</a></li> + {{ end }} + {{ if $paginator.HasNext }} + <li><a href="{{ $paginator.Next.URL }}" class="button alt big">Next</a></li> + {{ end }} </ul> </footer> diff --git a/layouts/index.html b/layouts/index.html index 3c9aeec..877611c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -39,7 +39,7 @@ <div class="12u"> {{ $paginator := .Paginate (where .Data.Pages "Type" "blog") 2 }} - {{ partial "blog.html" (dict "context" . "paginator" $paginator) }} + {{ partial "blog.html" (dict "title" .Site.Params.Blog.title "paginator" $paginator) }} </div> </div> diff --git a/layouts/partials/blog.html b/layouts/partials/blog.html index 9ff5e2d..cb99ffa 100644 --- a/layouts/partials/blog.html +++ b/layouts/partials/blog.html @@ -1,7 +1,7 @@ <!-- Blog --> <section id="blog"> <header class="major"> - <h2>The Blog</h2> + <h2>{{ .title }}</h2> </header> <div class="row"> {{ range .paginator.Pages }} diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 0161637..4d63df0 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -6,7 +6,7 @@ <a href="{{ .Site.BaseURL }}#portfolio">My Portfolio</a> </li> <li> - <a href="{{ .Site.BaseURL }}#blog">My Blog</a> + <a href="{{ .Site.BaseURL }}/blog">{{ .Site.Params.Blog.title }}</a> <ul> {{ range first 5 (where .Site.Pages "Type" "blog") }} <li><a href="{{ .Permalink }}">{{ .Title }}</a></li> |