How to determine raw file's extension within template

Jekyll has a page.path variable. You could use {% assign ext = page.path | split: "." | last %} to get the extension.

1 Like