mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-07 19:36:12 -04:00
678 B
678 B
title | description | categories | menu | keywords | signature | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
urls.JoinPath | Joins the provided elements into a URL string and cleans the result of any ./ or ../ elements. |
|
|
|
|
{{ urls.JoinPath "" }} → "/"
{{ urls.JoinPath "a" }} → "a"
{{ urls.JoinPath "a" "b" }} → "a/b"
{{ urls.JoinPath "/a" "b" }} → "/a/b"
{{ urls.JoinPath "https://example.org" "b" }} → "https://example.org/b"
{{ urls.JoinPath (slice "a" "b") }} → "a/b"
Unlike the path.Join
function, urls.JoinPath
retains consecutive leading slashes.