fn: pathto



The syntax for pathto calls is:




The pathto function takes a single string parameter specifying either a tracked name or an absolute path to a file from the project root directory and returns the relative path from the file being built to either the output file for the tracked name specified by the parameter or the file specified by the input parameter.

Note: You can optionally specify whether the input parameter is for a file or name, see the Options section.


The following options are available for pathto calls:

option description
file input parameter is an absolute path to a file from the project root directory
name input parameter is a tracked name
option description

n++ example

Examples of pathto being used with n++:

<a href="@pathto(index)">home</a>
<img src="@pathto('assets/images/logo.svg')">

	<ul class="drop_menu">
		<li class="dm_li">
			<a href="@pathto(index)">Home</a>

		<li class ="dm_li">
			<div class="dm_text">Documentation</div>
			<ul class ="drop_submenu">
				<li class="dsm_li"><a href="@pathto(documentation/installing_nift)">Installing Nift</a></li>
				<li class="dsm_li"><a href="@pathto(documentation/nift_tutorial)">Nift tutorial</a></li>
				<li class="dsm_li"><a href="@pathto(documentation/nift_commands)">Nift commands</a></li>

		<li class ="dm_li">
			<a href="@pathto(support)">Support</a>