Skip to content

Commit

Permalink
tpl: Add hasSuffix alias
Browse files Browse the repository at this point in the history
strings.HasPrefix already has an alias of hasPrefix
but strings.HasSuffix has no such alias.
This PR adds a hasSuffix alias to the tpl function with corresponding
function documentation.
It also adds a Minor update to the hasPrefix function documentation
re: keywords and relatedfuncs.

 Completes gohugoio/hugo#10474
  • Loading branch information
jfish2 authored and bep committed Mar 8, 2023
1 parent 4e0b98d commit 2a38c40
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/en/functions/hasPrefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ categories: [functions]
menu:
docs:
parent: "functions"
keywords: []
keywords: [strings]
signature: ["hasPrefix STRING PREFIX"]
workson: []
hugoversion:
relatedfuncs: []
relatedfuncs: [hasSuffix]
deprecated: false
aliases: []
---
Expand Down
21 changes: 21 additions & 0 deletions content/en/functions/hasSuffix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: hassuffix
linktitle: hasSuffix
description: Tests whether a string ends with suffix.
date: 2023-03-01
publishdate: 2023-03-01
lastmod: 2023-03-01
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [strings]
signature: ["hasSuffix STRING SUFFIX"]
workson: []
hugoversion:
relatedfuncs: [hasPrefix]
deprecated: false
aliases: []
---

* `{{ hasSuffix "Hugo" "go" }}` → true

0 comments on commit 2a38c40

Please sign in to comment.