mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
tpl/urls: Return empty string when JoinPath has zero args
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
065ae003a5
commit
150d190ff0
@@ -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:
|
||||
@@ -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"
|
||||
|
Reference in New Issue
Block a user