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 "".
InputArgumentsReturns
Sourcestringno argumentsstringBasicSource
Returns the file extension without the leading dot.
Given
{"path": "avatar.png"}Template
{{ path | ext }}Result
pngCompoundSource
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
gzFull 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