DocumentUrlContext.RootUrl Property

Namespace
Kampute.DocToolkit.Routing
Assembly
  • Kampute.DocToolkit.dll

Definition

Gets the absolute or relative URL to the root of the documentation site for the current context.
public abstract Uri RootUrl { get; }

Property Value

Uri
The URL that serves as the reference point for resolving relative URLs within the current context.

Remarks

The DocumentUrlContext.RootUrl property serves as a critical reference point for constructing site-wide resource URLs and cross-document navigation that works consistently regardless of the document's depth in the hierarchy. It is especially useful for breadcrumb navigation and referencing shared resources like CSS, JavaScript files, and images from documents at any level in the site hierarchy.

When the root URL is a relative URL, it represents the path from the current document to the root of the documentation site. The following examples illustrate how a relative root URL is computed based on document location:

  • For a document at the root level: ""
  • For a document in a first-level directory: "../"
  • For a document in a second-level directory: "../../"