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