I’m using a yml file to store information about a series of projects that I’m using to generate a series of proxy pages. So far, everything has worked pretty well, but I want the user to be able to navigate to next and previous pages.
I’ve thought of a few approaches but I’m not conversant enough with Ruby to do anything but a hack:
- instead of using SEO-friendly slugs, use index values for each project, therefore making linking easily based on an integer value. This I could do as I saw in another example but I don’t want to give up my nice URLs.
- add
next_project_slug
andprevious_project_slug
to each project in the YML, but that’s messy… this is my hacky solution. - Ideally, I could find another solution that finds the links of the ‘neighbor’ pages for my projects. It seems as though something in config.rb that would pass in locals for the neighbor slug values might work.
Am open to any ideas on a clean implementation of this. Thanks!