How to limit the number of posts shown on home page?

114 views
Skip to first unread message

Jeremy Cowgar

unread,
Sep 18, 2014, 5:57:26 PM9/18/14
to hugo-d...@googlegroups.com
I added 37 posts from another blog to one I am working on with Hugo, but it seems no matter what I do on the home page, I get all 37 posts. I have tried various themes with no change.

I am hoping for pagination on the index page, or at least the last 5 posts and then an archive page.

Thanks!

--
Jeremy

loads...@gmail.com

unread,
Sep 18, 2014, 8:00:17 PM9/18/14
to hugo-d...@googlegroups.com

"first x" might help you here Jeremy. There's an example and information on List Templates page of the Hugo website. 

ie... 
{{ range first 10 .Data.Pages }}
    {{ .Render "summary"}}
{{ end }}

or...
{{ range first 5 (where .Data.Pages.ByDate "Section" "posts") }}


#AllHailHugo
Reply all
Reply to author
Forward
0 new messages