GetLink(IExecutionState, NormalizedPath, string, NormalizedPath, bool, bool, bool, bool, bool, bool) Method
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.


public static string GetLink(this IExecutionState executionState, in NormalizedPath path, string host, in NormalizedPath root, bool useHttps, bool hideIndexPages, bool hideExtensions, bool lowercase, bool makeAbsolute, bool hiddenPageTrailingSlash)


Name Type Description
executionState IExecutionState The execution state.
path NormalizedPath The path to generate a link for.
host string The host to use for the link.
root NormalizedPath The root of the link. The value of this parameter is prepended to the path.
useHttps bool If set to true, HTTPS will be used as the scheme for the link.
hideIndexPages bool If set to true, index files will be hidden.
hideExtensions bool If set to true, extensions will be hidden.
lowercase bool If set to true, links will be rendered in all lowercase.
makeAbsolute bool If path is relative, setting this to true (the default value) will assume the path relative from the root of the site and make it absolute by prepending a slash and root to the path. Otherwise, false will leave relative paths as relative and won't prepend a slash (but host, useHttps, and root will have no effect). If path is absolute, this value has no effect and host, useHttps, and root will be applied as appropriate.
hiddenPageTrailingSlash bool Indicates that a trailing slash should be appended when hiding a page due to hideIndexPages. Setting to false means that hiding a page will result in the parent path without a trailing slash.

Return Value

Type Description
string A string representation of the path suitable for a web link with the specified root and hidden file name or extension.