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++:

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