This seems to be a way to link separate topics rather than adding page navigation to a single topic
I did make a bit of progress on the pagination. The idea was to uses the ?page=x
function built into discourse to navigate between “pages” and basically block further messages from being loaded in by overriding the post-stream functions that load in the next batch of posts.
See below for more details (and unresolved issue)
I added pagination buttons at the top and bottom of each topic. One thing I didn’t figure out yet is how to get the total number of pages in a topic so I know how many buttons to display. It’s easy from the back end but I’d prefer this to be a theme component over a plugin so the options of how to do it are more limited.
With these two things, it seems like it would be a mostly functional pagination system. I’m sure there will be some odd behaviours though that will need polishing, like whether deleted posts count as a message on a page or controlling how many posts should be shown when jumping to the last page.
I have been periodically going back to this problem. Not sure if I’ll ever reach a clean solution but I think a hacky-mostly functional solution could exist