The template object

The template object has a handful of attributes.

Referencing just template returns the name of the template used to render the current page, with the .liquid extension omitted.

template.directory

Returns the name of the template's parent directory. Returns nil for templates whose parent directory is the templates/ folder.

template.name

Returns the template's name without the template's custom suffix, if it exists, or the .liquid extension.

template.suffix

Returns the name of the custom template without the template.name prefix or the .liquid extension. Returns nil if a custom template is not being used.