I have an experimental feature that I would like to implement on my website. The general concept is to model all page -> page transitions as a probabilistic event.
- In the case of a permalink from one page to another, you can say it is drawing from a distribution over pages with 100% chance on that permalink’d page.
- In the experimental case, all words on a page function as “links” – they can send you to a page that is drawn from a distribution over a set of pages.
I see that Hugo already models a collection of pages for each page to support the
.Next page-variable. Is there a way for me to flag a page such that the
.Next operation is overridden by my own logic which does the probabilistic transition? I’m guessing this can be flagged as a custom front matter field.
One requirement is that, while the server-side may maintain a “prior” distribution of next pages for any given content page, I would like to be able to provide additional context with the next-page-request made from the frontend, such that the backend can produce a modified “posterior” distribution, i.e. a modified distribution based on the word that a user clicked.
Let me know if there is a path to implementing “customizability” of the
.Next page handler. I am willing to contribute if desired, or simply fork and host my own custom version. Or, if there is already a way to implement my probabilistic feature, advice on how to best approach this within Hugo would be much appreciated. Thank you!