This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

ContentRoute Pennington.Routing

Describes the canonical location of a piece of content, its output file, and originating locale.

Properties

CanonicalPath UrlPath
required
Canonical URL path (leading slash, trailing slash for directories).
IsDefaultLocale bool
True when this route belongs to the default (unprefixed) locale.
IsFallback bool
True when this route serves default-locale content as a fallback for a missing translation.
Locale string
Locale code for this route; empty for the default locale.
OutputFile FilePath
required
Relative output file path written during static generation.
SourceFile FilePath?
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

canonicalBase UrlPath

Returns

UrlPath

Pennington.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; }
}