#How to set up pagination

4 messages · Page 1 of 1 (latest)

white kayak
#

Hey magicians!

Its time for me to get back on working on my Astro site. Last time I build a new site connected to WP to fetch my posts. I followed @gloomy smelt 's article and guidance. https://wpengine.com/builders/building-headless-wordpress-site-astro/

At that time, I totally forgot to check on setting up pagination for fetched posts. Since I'm not the hottest dev in the classroom, I struggle with figuring out how to set up pagination for this. Search, or some sort of live-search would also be necessary.

Here's the JS fetching the WP posts from my previous Wordpress site.
https://github.com/mrjohnmac/JohnMacReload/blob/Main/src/lib/api.js

Here's the main layout mapping the posts.
https://github.com/mrjohnmac/JohnMacReload/blob/Main/src/layouts/ArchiveLayout.astro

Any suggestions or pointers on how I should start looking into this?

With love from Thailand,

spiral hollyBOT
#
Quiet in here?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

torpid mauve
#

I think you can just
return paginate