Skip to content

Commit

Permalink
docs: Create path.Clean documentation
Browse files Browse the repository at this point in the history
Related to #9005
  • Loading branch information
jmooring authored Oct 9, 2021
1 parent 26f1919 commit f8d132d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/content/en/functions/path.Clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: path.Clean
description: Replaces path separators with slashes (`/`) and removes extraneous separators.
date: 2021-10-08
# publishdate: 2018-11-28
# lastmod: 2018-11-28
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [path]
signature: ["path.Clean PATH"]
---

`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"
```

0 comments on commit f8d132d

Please sign in to comment.