path.Join
Returns the shortest path name equivalent to the given path elements joined into a single path, after replacing path separators with slashes (/).
- Syntax
- path.Join ELEMENT...
- Returns
- string
See Go’s path.Join and path.Clean documentation for details.
{{ path.Join "partial" "news.html" }} → partial/news.html
{{ path.Join "partial/" "news.html" }} → partial/news.html
{{ path.Join "foo/bar" "baz" }} → foo/bar/baz
{{ path.Join "foo" "bar" "baz" }} → foo/bar/baz
{{ path.Join "foo" "" "baz" }} → foo/baz
{{ path.Join "foo" "." "baz" }} → foo/baz
{{ path.Join "foo" ".." "baz" }} → baz
{{ path.Join "/.." "foo" ".." "baz" }} → bazLast updated:
October 10, 2026
:
theme: Migrate aliases to a redirects data file (b732eba6c)
Improve this page