Skip to content

Commit

Permalink
tpl/urls: Return empty string when JoinPath has zero args
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored and bep committed May 20, 2023
1 parent 310ce94 commit 0e0c7b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/en/functions/urls.JoinPath.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
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]
menu:
docs:
Expand All @@ -10,6 +10,7 @@ signature: ["urls.JoinPath ELEMENT..."]
---

```go-html-template
{{ urls.JoinPath }} → ""
{{ urls.JoinPath "" }} → "/"
{{ urls.JoinPath "a" }} → "a"
{{ urls.JoinPath "a" "b" }} → "a/b"
Expand Down

0 comments on commit 0e0c7b2

Please sign in to comment.