fn: pathtofile
[contents]

Contents

Syntax

The syntax for pathtofile calls is:

f++:  
pathtofile(string)

n++:  
@pathtofile(string)

Description

The pathtofile function takes a single string parameter specifying an absolute path to a file from the project root directory and returns the relative path from the file being built to the file specified by the input parameter.

n++ example

Examples of pathtofile being used with n++:

<img src="@pathtofile('assets/images/logo.svg')">
<link rel="stylesheet" 
      type="text/css" 
      href="@pathtofile(site/assets/main.css)">