tpl: Add hasSuffix alias

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 https://github.com/gohugoio/hugo/issues/10474
This commit is contained in:
Jonathan Fisher authored and Bjørn Erik Pedersen committed 2023-03-08 10:18:34 +01:00
1 parent 4e0b98d546
commit 2a38c40464
2 files changed
+23 -2

No files matched your search

+2 -2
View File
@@ -9,11 +9,11 @@ categories: [functions]
menu: menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [] keywords: [strings]
signature: ["hasPrefix STRING PREFIX"] signature: ["hasPrefix STRING PREFIX"]
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: [hasSuffix]
deprecated: false deprecated: false
aliases: [] aliases: []
--- ---
+21
View File
@@ -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