Saga icon indicating copy to clipboard operation
Saga copied to clipboard

Make it easier to link to prev/next pages within the `itemWriter`

Open kevinrenskers opened this issue 4 months ago • 0 comments

Let's say you're rendering a folder of articles, each article to its own html file. You might want to add links to the previous / next article at the bottom of the page. Saga currently doesn't really make this very easy to do, case in point: the spamusement.cc site. In its comic template there's this sort of code:

  let index = items.firstIndex(where: { $0.metadata.id == context.item.metadata.id })!
  let previous = index > 0 ? items[index-1] : nil
  let next = index < items.count - 1 ? items[index+1] : nil

Ideally Saga should just make this available immediately.

kevinrenskers avatar Sep 30 '25 21:09 kevinrenskers