mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 09:04:41 -04:00
Update comparison operators (#2104)
These became variadic with https://github.com/gohugoio/hugo/pull/6775
This commit is contained in:
parent
4241135e0e
commit
56e137043c
@ -1,16 +1,21 @@
|
|||||||
---
|
---
|
||||||
title: eq
|
title: eq
|
||||||
description: Returns the boolean truth of arg1 == arg2.
|
description: Returns the boolean truth of arg1 == arg2 || arg1 == arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["eq ARG1 ARG2"]
|
signature: ["eq ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if eq .Section "blog" }}current{{ end }}
|
{{ eq 1 1 }} → true
|
||||||
|
{{ eq 1 2 }} → false
|
||||||
|
|
||||||
|
{{ eq 1 1 1 }} → true
|
||||||
|
{{ eq 1 1 2 }} → true
|
||||||
|
{{ eq 1 2 1 }} → true
|
||||||
|
{{ eq 1 2 2 }} → false
|
||||||
```
|
```
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
---
|
---
|
||||||
title: ge
|
title: ge
|
||||||
description: Returns the boolean truth of arg1 >= arg2.
|
description: Returns the boolean truth of arg1 >= arg2 && arg1 >= arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["ge ARG1 ARG2"]
|
signature: ["ge ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if ge 10 5 }}true{{ end }}
|
{{ ge 1 1 }} → true
|
||||||
|
{{ ge 1 2 }} → false
|
||||||
|
{{ ge 2 1 }} → true
|
||||||
|
|
||||||
|
{{ ge 1 1 1 }} → true
|
||||||
|
{{ ge 1 1 2 }} → false
|
||||||
|
{{ ge 1 2 1 }} → false
|
||||||
|
{{ ge 1 2 2 }} → false
|
||||||
|
|
||||||
|
{{ ge 2 1 1 }} → true
|
||||||
|
{{ ge 2 1 2 }} → true
|
||||||
|
{{ ge 2 2 1 }} → true
|
||||||
```
|
```
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
---
|
---
|
||||||
title: gt
|
title: gt
|
||||||
description: Returns the boolean truth of arg1 > arg2.
|
description: Returns the boolean truth of arg1 > arg2 && arg1 > arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["gt ARG1 ARG2"]
|
signature: ["gt ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if gt 10 5 }}true{{ end }}
|
{{ gt 1 1 }} → false
|
||||||
|
{{ gt 1 2 }} → false
|
||||||
|
{{ gt 2 1 }} → true
|
||||||
|
|
||||||
|
{{ gt 1 1 1 }} → false
|
||||||
|
{{ gt 1 1 2 }} → false
|
||||||
|
{{ gt 1 2 1 }} → false
|
||||||
|
{{ gt 1 2 2 }} → false
|
||||||
|
|
||||||
|
{{ gt 2 1 1 }} → true
|
||||||
|
{{ gt 2 1 2 }} → false
|
||||||
|
{{ gt 2 2 1 }} → false
|
||||||
```
|
```
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
---
|
---
|
||||||
title: le
|
title: le
|
||||||
description: Returns the boolean truth of arg1 <= arg2.
|
description: Returns the boolean truth of arg1 <= arg2 && arg1 <= arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["le ARG1 ARG2"]
|
signature: ["le ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if le 5 10 }}true{{ end }}
|
{{ le 1 1 }} → true
|
||||||
|
{{ le 1 2 }} → true
|
||||||
|
{{ le 2 1 }} → false
|
||||||
|
|
||||||
|
{{ le 1 1 1 }} → true
|
||||||
|
{{ le 1 1 2 }} → true
|
||||||
|
{{ le 1 2 1 }} → true
|
||||||
|
{{ le 1 2 2 }} → true
|
||||||
|
|
||||||
|
{{ le 2 1 1 }} → false
|
||||||
|
{{ le 2 1 2 }} → false
|
||||||
|
{{ le 2 2 1 }} → false
|
||||||
```
|
```
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
---
|
---
|
||||||
title: lt
|
title: lt
|
||||||
description: Returns the boolean truth of arg1 < arg2.
|
description: Returns the boolean truth of arg1 < arg2 && arg1 < arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["lt ARG1 ARG2"]
|
signature: ["lt ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if lt 5 10 }}true{{ end }}
|
{{ lt 1 1 }} → false
|
||||||
|
{{ lt 1 2 }} → true
|
||||||
|
{{ lt 2 1 }} → false
|
||||||
|
|
||||||
|
{{ lt 1 1 1 }} → false
|
||||||
|
{{ lt 1 1 2 }} → false
|
||||||
|
{{ lt 1 2 1 }} → false
|
||||||
|
{{ lt 1 2 2 }} → true
|
||||||
|
|
||||||
|
{{ lt 2 1 1 }} → false
|
||||||
|
{{ lt 2 1 2 }} → false
|
||||||
|
{{ lt 2 2 1 }} → false
|
||||||
```
|
```
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
---
|
---
|
||||||
title: ne
|
title: ne
|
||||||
description: Returns the boolean truth of arg1 != arg2.
|
description: Returns the boolean truth of arg1 != arg2 && arg1 != arg3.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [operators,logic]
|
keywords: [comparison,operators,logic]
|
||||||
signature: ["ne ARG1 ARG2"]
|
signature: ["ne ARG1 ARG2 [ARG...]"]
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ if ne .Section "blog" }}current{{ end }}
|
{{ ne 1 1 }} → false
|
||||||
|
{{ ne 1 2 }} → true
|
||||||
|
|
||||||
|
{{ ne 1 1 1 }} → false
|
||||||
|
{{ ne 1 1 2 }} → false
|
||||||
|
{{ ne 1 2 1 }} → false
|
||||||
|
{{ ne 1 2 2 }} → true
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user