DocumentLink(IHtmlHelper, IDocument, string, IDictionary<object, object>) Method
Gets an anchor HTML element for the specified document using the document destination. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
Namespace
Statiq.Razor
Containing Type
IHtmlHelperExtensions

Syntax

public static IHtmlContent DocumentLink(this IHtmlHelper htmlHelper, IDocument document, string linkText, IDictionary<object, object> htmlAttributes)

Parameters

Name Type Description
htmlHelper IHtmlHelper The HTML helper.
document IDocument The document to generate an anchor element for.
linkText string The title to use for the anchor, or null to use the document title.
htmlAttributes IDictionary<object, object> HTML attributes to add to the link.

Return Value

Type Description
IHtmlContent A string representation of the path suitable for a web link.