ext_trim
Returns the file path without its trailing extension.
Only the final extension is removed, so a path like "archive.tar.gz" keeps its "tar" segment and loses just ".gz". Directory segments are preserved untouched. A path with no extension, or one whose last element is a directory (trailing slash), comes back unchanged. A dotfile with nothing before the dot, such as ".gitignore", is treated by the standard library as being all extension, so trimming it yields an empty string.
stringno argumentsstringReturns the path without its trailing extension, removing only the final segment and preserving the directory portion.
Given
{"path": "docs/report.pdf"}Template
{{ path | ext_trim }}Result
docs/reportRemoves only the final extension, so a double-suffixed archive keeps its inner segment.
Given
{"path": "backup/archive.tar.gz"}Template
{{ path | ext_trim }}Result
backup/archive.tarLeaves a path that has no extension exactly as it was.
Given
{"path": "bin/tool"}Template
{{ path | ext_trim }}Result
bin/tool