ContentRoute Pennington.Routing
Describes the canonical location of a piece of content, its output file, and originating locale.
Properties
CanonicalPathUrlPath- requiredCanonical URL path (leading slash, trailing slash for directories).
IsDefaultLocalebool- True when this route belongs to the default (unprefixed) locale.
IsFallbackbool- True when this route serves default-locale content as a fallback for a missing translation.
Localestring- Locale code for this route; empty for the default locale.
OutputFileFilePath- requiredRelative output file path written during static generation.
SourceFileFilePath?- Originating source file on disk, if any.
Methods
AbsoluteUrl
#public UrlPath AbsoluteUrl(UrlPath canonicalBase)
Compose the canonical path with the site's canonical base URL; see Combine.
Parameters
canonicalBaseUrlPath
Returns
UrlPathPennington.Routing.ContentRoute
namespace Pennington.Routing;
/// Describes the canonical location of a piece of content, its output file, and originating locale.
public record ContentRoute
{
/// Compose the canonical path with the site's canonical base URL; see Combine.
public UrlPath AbsoluteUrl(UrlPath canonicalBase)
;
/// Canonical URL path (leading slash, trailing slash for directories).
public UrlPath CanonicalPath { get; set; }
/// True when this route belongs to the default (unprefixed) locale.
public bool IsDefaultLocale { get; }
/// True when this route serves default-locale content as a fallback for a missing translation.
public bool IsFallback { get; set; }
/// Locale code for this route; empty for the default locale.
public string Locale { get; set; }
/// Relative output file path written during static generation.
public FilePath OutputFile { get; set; }
/// Originating source file on disk, if any.
public FilePath? SourceFile { get; set; }
}