HUGO
Menu
GitHub 87548 stars Mastodon

Eq

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

Syntax

PAGE1.Eq PAGE2

Returns

bool

在此示例中,我们列出当前栏目中的所有页面,但不包括当前页面。

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

{{ end }}


Last updated: January 1, 0001
Improve this page