Commit ea7b4a91 authored by Yurizal Susanto's avatar Yurizal Susanto

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.
parent 22f7db22
......@@ -20,6 +20,10 @@ disqusShortname = "" # Your disqus shortname
tagline = "Nothing sweeter than this" # Site's Tagline (Subtitle or Keyword)
themeAttrib = true # If true give attribution to this theme
licenseURL = "/about/license" # URL to license file, can be outside of your domain
# Configure which section for Latest Posts
postSection = "blog"
# Configure which section for Latest Works
workSection = "work"
# 404 Configuration
head404 = "Sorry, I can find what you want."
......
......@@ -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" . }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment