Hi ahamagi ,
This seems to be possible using Buttonizer! 😎
Create a Next and a Previous button and use the button action, Javascript function.
Then copy and paste these into the javascript editor:
Next button:
const minSteps = 0;
const maxSteps = 100;
if(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)) {
let currStep = Number(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)[0].match(/\d+/g)[0]) + 1 > maxSteps ? minSteps : Number(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)[0].match(/\d+/g)[0]) + 1
window.location.pathname = `/gen_${currStep}.html`;
}
Previous button:
const minSteps = 0;
const maxSteps = 100;
if(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)) {
let currStep = Number(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)[0].match(/\d+/g)[0]) - 1 < minSteps ? maxSteps : Number(window.location.pathname.match(/^\/gen_([0-9]+).html$/g)[0].match(/\d+/g)[0]) - 1
window.location.pathname = `/gen_${currStep}.html`;
}
This will increase/decrease the number if the permalink ends with "/gen_(number).html"
You can set the limit of the buttons by changing the minSteps
and maxSteps
on both buttons.
Please let me know if this works for you! 🙂