diff options
author | Yurizal Susanto <rizalsagi@gmail.com> | 2018-03-22 13:17:55 +0300 |
---|---|---|
committer | Yurizal Susanto <rizalsagi@gmail.com> | 2018-03-22 13:17:55 +0300 |
commit | ea7b4a91ea1598ab795406cd95bf5681a8806b8b (patch) | |
tree | 09d8fb1b75e2693aa2b2446c45d3fbe0d233d1be /layouts | |
parent | 22f7db22fb1e731345d726dd9f3f527ce53246af (diff) |
Add ability to configure latest post
Now people can use different section as latest post and latest work.
Make the content less rigid for other people.
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/index.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/layouts/index.html b/layouts/index.html index d475de2..150b1d5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,22 +4,27 @@ {{ partial "title" . }} {{ with .Content }}{{.}}{{ end }} </header> -{{ $latestcount := .Site.Params.LatestCount | default 3 }} + {{ $latestcount := .Site.Params.LatestCount | default 3 }} + {{ $postsection := .Site.Params.PostSection | default "blog" }} <section> <h4>{{ T "latestPost" }}</h4> <ul class="no-bullet"> - {{- range (first $latestcount (where .Pages "Section" "blog")) -}} + {{- range (first $latestcount (where .Pages "Section" $postsection)) -}} {{ partial "li" . }} {{- end -}} </ul> </section> + + {{ $worksection := .Site.Params.WorkSection | default "work" }} + {{ with .Site.GetPage "section" $worksection }} <section> <h4>{{ T "latestWork" }}</h4> <ul class="no-bullet"> - {{- range (first $latestcount (where .Pages "Section" "work")) -}} + {{- range (first $latestcount (where .Pages "Section" $worksection)) -}} {{ partial "li" . }} {{- end -}} </ul> </section> + {{ end }} </article> {{ partial "footer" . }} |