First post on the list of posts (and single post)

{{ range $k, $v := .Site.RegularPages }}
  {{ if not $k }}
    I am the first item.
  {{ end }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

Use .IsPage. See https://gohugo.io/variables/page/#page-variables.

3 Likes