mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 16:17:21 +00:00
tpl/urls: Return empty string when JoinPath has zero args
This commit is contained in:
1 parent
310ce949ad
commit
0e0c7b25e3
1 file changed
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: urls.JoinPath
|
title: urls.JoinPath
|
||||||
description: Joins the provided elements into a URL string and cleans the result of any ./ or ../ elements.
|
description: Joins the provided elements into a URL string and cleans the result of any ./ or ../ elements. If the argument list is empty, JoinPath returns an empty string.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
@@ -10,6 +10,7 @@ signature: ["urls.JoinPath ELEMENT..."]
|
|||||||
---
|
---
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
{{ urls.JoinPath }} → ""
|
||||||
{{ urls.JoinPath "" }} → "/"
|
{{ urls.JoinPath "" }} → "/"
|
||||||
{{ urls.JoinPath "a" }} → "a"
|
{{ urls.JoinPath "a" }} → "a"
|
||||||
{{ urls.JoinPath "a" "b" }} → "a/b"
|
{{ urls.JoinPath "a" "b" }} → "a/b"
|
||||||
|
|||||||
Reference in new issue
Block a user