ext

Returns the file extension without the leading dot, for example 'png' for 'avatar.png'.

Only the part after the final dot is returned, so "archive.tar.gz" yields "gz" and a name with no dot yields "".

InputArgumentsReturnsstringno argumentsstring
Source
BasicSource

Returns the file extension without the leading dot.

Given

{"path": "avatar.png"}

Template

{{ path | ext }}

Result

png
CompoundSource

Returns only the part after the final dot, so a compound name yields its last extension.

Given

{"path": "archive.tar.gz"}

Template

{{ path | ext }}

Result

gz
Full pathSource

Reads the extension from the final element of a multi-segment path, ignoring the directories that precede it.

Given

{"path": "logs/2026/app.log"}

Template

{{ path | ext }}

Result

log