mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
f8d132d731
Related to #9005
627 B
627 B
title | description | date | categories | menu | keywords | signature | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path.Clean | Replaces path separators with slashes (`/`) and removes extraneous separators. | 2021-10-08 |
|
|
|
|
path.Clean
replaces path separators with slashes (/
) and removes extraneous separators, including trailing separators.
{{ path.Clean "foo//bar" }} → "foo/bar"
{{ path.Clean "/foo/bar/" }} → "/foo/bar"
On a Windows system, if .File.Path
is foo\bar.md
, then:
{{ path.Clean .File.Path }} → "foo/bar.md"