mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
21
docs/content/en/methods/page/Eq.md
Normal file
21
docs/content/en/methods/page/Eq.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Eq
|
||||
description: Reports whether two Page objects are equal.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related: []
|
||||
returnType: bool
|
||||
signatures: [PAGE1.Eq PAGE2]
|
||||
---
|
||||
|
||||
In this contrived example from a single page template, we list all pages in the current section except for the current page.
|
||||
|
||||
```go-html-template
|
||||
{{ $currentPage := . }}
|
||||
{{ range .CurrentSection.Pages }}
|
||||
{{ if not (.Eq $currentPage) }}
|
||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
Reference in New Issue
Block a user