path.BaseName
Returns the last element of the given path with its extension removed, if present, after replacing path separators with slashes (/).
- Syntax
- path.BaseName PATH
- Returns
- string
{{ path.BaseName "a/news.html" }} → news
{{ path.BaseName "news.html" }} → news
{{ path.BaseName "a/b/c" }} → c
{{ path.BaseName "/x/y/z/" }} → z
{{ path.BaseName "" }} → .Last updated:
October 10, 2026
:
theme: Migrate aliases to a redirects data file (b732eba6c)
Improve this page