Page

Eq

报告两个 Page 对象是否相等。

签名
PAGE1.Eq PAGE2
返回类型
bool

在这个刻意构造的例子中,我们列出当前 section 中除当前页面之外的所有页面。

layouts/page.html
{{ $currentPage := . }}
{{ range .CurrentSection.Pages }}
  {{ if not (.Eq $currentPage) }}
    <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
  {{ end }}
{{ end }}