Commit ea7b4a91 authored by Yurizal Susanto's avatar Yurizal Susanto
Browse files

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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."
+8 −3
Original line number Diff line number Diff line
@@ -5,21 +5,26 @@
		{{ with .Content }}{{.}}{{ end }}
	</header>
	{{ $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" . }}