See the code for context. When shuffling some items, sometimes the current post appears in the list. Should that happen?
{{- range site.RegularPages | shuffle | first 8 }}
{{- if not (eq $.RelPermalink .RelPermalink) }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{- end }}
{{- end }}
This is a comment through a black box, because everything depends on the full layout file, not just 5 lines of code. The $.RelPermalink is, what might be the problem. The $ might not be the current page, but one that is within the current page (list pages, tag-lists, etc).
Also, you range with $k, $v, but in the range you use the . - this shouldn’t be an issue, but could be.