{{ $page := . }}
{{ with .Params.series }}
    {{ $series := (site.GetPage "/series").GetPage . }}
    <div class="card mb-5">
        <header class="card-header has-background-primary has-text-white">
            <p class="card-header-title has-text-white">
                Series
            </p>
        </header>
        <div class="card-content content is-size-7">
            {{ with $series.Params.on }}
                <p>This post is part of <a href="{{ $series.RelPermalink }}">a series on {{.}}</a>.</p>
            {{ else }}
                <p>This post is part of the series <a href="{{ $series.RelPermalink }}" class="has-text-white">{{ $series.Title }}</a></p>
            {{ end }}
            <ul>
                {{ range $series.Pages }}
                    <li>
                        {{ if ne . $page }}<a href="{{ .RelPermalink }}">{{ else }}<span id="current">&gt; {{ end }}
                            {{ .Title }}
                        {{ if ne . $page }}</a>{{ else }} &lt;</span>{{ end }}
                    </li>
                {{ end }}
            </ul>
        </div>
    </div>
{{ end }}
