Skip to content

Commit dc836bd

Browse files
committed
fix: handle no posts
1 parent adb19bd commit dc836bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

layouts/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ <h3>Posts</h3>
3131
<div>
3232

3333
<!-- orders content according to the "publishdate" field in front matter -->
34+
{{ with .Site.Data.personalize.PostLimit }}
3435
{{ range first .Site.Data.personalize.PostLimit .Pages.ByPublishDate }}
3536
<div>
3637
<a href="{{ .Permalink }}">{{ .Title }}</a><br />
3738
<time>{{ .Date.Format "January 2, 2006" }}</time>
3839
</div>
3940
<br />
4041
{{ end }}
42+
{{ end }}
4143

4244

4345
<h3><a href="posts/">View all posts</a></h3>

0 commit comments

Comments
 (0)