Grouping content by custom metadata and then sorting by custom metadata in both list *and* single content pages

I would like to group a series of posts/articles into series and then within the series, sort them by a series number. I think I could do this by substituting series_no with weight, but I’d like to keep the metadata naming more intuitive. Let’s say the following is an example front matter for a series on CSS, which is a series among a group of series for front-end web development:

---
title: CSS basics
subtitle: Learn about selectors and specificity.
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
author: John Doe
series: css
series_no: 1
date: 2015-12-10
publishDate: 2015-12-10
---

I would then want to include both “next” and “previous” links in the bottom of the single content pages bases on the series_no for that particular piece. I’ve done this with liquid/jekyll, but it definitely gets slow. Here is a list page example that shows the type of desired output I’m looking for. Here is the sample single page.

So I figured out how to work this on the list page, but I’m still struggling with the individual content pages to include “next” and “previous” so that they are sorted by series_no. Eg, if the user is on “CSS Series: Part 2,” I would like the “previous” link in the bottom to point to series_no: 01 and the “next” link in the bottom to point to series_no:02. Then, let’s say there are 5 pieces in the “CSS” series and the next series is “Javascript.” I’d like for the “next” link in series_no: 5 in series: css to point to series_no: 1 in series: javascript.

Here is the solution I figured out for the list page:

{{ range .Data.Pages.GroupByParam "series" }} 
      <h3>{{ .Key }}</h3>
      <ul>
         {{ range sort .Pages "Params.series_no" }}
            <li><a href="{{ .Permalink }}">{{ .Params.series_no }} - {{ .Title }}</a></li>
	{{ end }}
      </ul>
{{ end }}

But I’m still in need of a solution for the individual tutorial pages for next/previous links. Thoughts?

You could use the date for sorting. I assume that you’ve created the tutorials in chronological order. Read this post of more information. There are some issues with the filters but maybe does one of the mentioned scripts work.