As I have the need to display quite a lot of data, I’m using Bootstrap pagination and had need to make a re-usable “mixin” that I can insert into many different pages. There are a few examples out there on t’internet that do this, but none that did exactly what I needed, so I’ve created by own.
To use it you just enter something like this in your Jade template:
– var pages = 10
– var currentpage = 3
+pagination(1, pages, currentpage, ‘/index/’)
And you end up with a pagination control that looks like this: