bugfix: use correct indexing when generating next/prev post links