This site provides a machine-readable index at /llms.txt.

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 Pennington.Routing.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
Default: false
True when this route serves default-locale content as a fallback for a missing translation.
Locale string
Default: ""
Locale code for this route; empty for the default locale.
OutputFile Pennington.Routing.FilePath
required
Relative output file path written during static generation.
SourceFile Pennington.Routing.FilePath?
Default: null
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

WithBaseUrl

#
public UrlPath WithBaseUrl(UrlPath baseUrl);

Composes the canonical path with a base URL path.

Parameters

baseUrl 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 required UrlPath CanonicalPath { get; init; }
/// True when this route belongs to the default (unprefixed) locale.
public bool IsDefaultLocale => string.IsNullOrEmpty(Locale);
/// True when this route serves default-locale content as a fallback for a missing translation.
public bool IsFallback { get; init; }
/// Locale code for this route; empty for the default locale.
public string Locale { get; init; } = "";
/// Relative output file path written during static generation.
public required FilePath OutputFile { get; init; }
/// Originating source file on disk, if any.
public FilePath? SourceFile { get; init; }
/// Composes the canonical path with a base URL path.
public UrlPath WithBaseUrl(UrlPath baseUrl);
}