helpers /  Path


Path helpers are node.js utilities for handling and transforming file paths. As with node.js:

"these helpers perform only string transformations. The file system is not consulted to check whether paths are valid."


Return the directory name of a path. Similar to the Unix dirname command.


{{_dirname '/foo/bar/baz/asdf/quux'}}

Renders to:



"Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string."

Parameters: string (the value to test against). Default: none


{{_extname 'index.html'}}

Renders to:



{{_extname 'index.'}}

Renders to:



{{_extname 'index'}}

Returns nothing.


Derive the relative path from one absolute path to another (e.g from path A, to path B).
Parameters: string (the value to test against)
Default: none


{{_relative "from" "to"}}


<a href="{{_relative "src" "dist"}}/assets/css/styles.css"></a>

Renders to:

<a href="../../dist/assets/css/styles.css"></a>

See the template for this page →

Find an error? Let us know →