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

TaxonomyOptions Pennington.Taxonomy

Configures one taxonomy axis (browse-by-cuisine, browse-by-tag, browse-by-audience, ...). Pass to AddTaxonomy; the extension validates the options and registers a TaxonomyContentService against them.

Properties

BaseUrl string
Base URL the taxonomy mounts under. The index lives at this URL; per-term pages at {BaseUrl}/{slug}/. Required.
EmitCrossReferences bool
Whether to publish a cross-reference per term (e.g. tag-csharp). Default true.
IndexPage Type
Razor component that renders the index at BaseUrl. Receives the full term list as a Terms parameter. Required.
LabelFor Func<TKey, string>
Optional human-readable label override. Default returns the key's string form.
SearchPriority int
Search-index priority for the discovered routes. Higher ranks first. Default 10.
SectionLabel string
Section label applied to the navigation entries. Defaults to the last segment of BaseUrl with the first letter uppercased.
SelectKey Func<TFrontMatter, TKey>
Single-valued projection. Set this OR SelectKeys — exactly one is required. Items whose projection returns null (when TKey is nullable) or the default value are skipped.
SelectKeys Func<TFrontMatter, IEnumerable<TKey>>
Multi-valued projection. Set this OR SelectKey — exactly one is required. Each returned key produces a (key, item) pair. Empty enumerations cause the item to be skipped.
SlugFor Func<TKey, string>
Slug encoder. Default lowercases the key's string form and replaces whitespace with hyphens; URL-encodes any remaining unsafe characters.
TermPage Type
Razor component that renders each per-term page at {BaseUrl}/{slug}/. Receives the matching TaxonomyTerm as a Term parameter. Required.

Pennington.Taxonomy.TaxonomyOptions

namespace Pennington.Taxonomy;

/// Configures one taxonomy axis (browse-by-cuisine, browse-by-tag, browse-by-audience, ...). Pass to AddTaxonomy; the extension validates the options and registers a TaxonomyContentService against them.
public class TaxonomyOptions
{
    /// Base URL the taxonomy mounts under. The index lives at this URL; per-term pages at {BaseUrl}/{slug}/. Required.
    
public string BaseUrl { get; set; }
/// Whether to publish a cross-reference per term (e.g. tag-csharp). Default true.
public bool EmitCrossReferences { get; set; }
/// Razor component that renders the index at BaseUrl. Receives the full term list as a Terms parameter. Required.
public Type IndexPage { get; set; }
/// Optional human-readable label override. Default returns the key's string form.
public Func<TKey, string> LabelFor { get; set; }
/// Search-index priority for the discovered routes. Higher ranks first. Default 10.
public int SearchPriority { get; set; }
/// Section label applied to the navigation entries. Defaults to the last segment of BaseUrl with the first letter uppercased.
public string SectionLabel { get; set; }
/// Single-valued projection. Set this OR SelectKeys — exactly one is required. Items whose projection returns null (when TKey is nullable) or the default value are skipped.
public Func<TFrontMatter, TKey> SelectKey { get; set; }
/// Multi-valued projection. Set this OR SelectKey — exactly one is required. Each returned key produces a (key, item) pair. Empty enumerations cause the item to be skipped.
public Func<TFrontMatter, IEnumerable<TKey>> SelectKeys { get; set; }
/// Slug encoder. Default lowercases the key's string form and replaces whitespace with hyphens; URL-encodes any remaining unsafe characters.
public Func<TKey, string> SlugFor { get; set; }
/// Razor component that renders each per-term page at {BaseUrl}/{slug}/. Receives the matching TaxonomyTerm as a Term parameter. Required.
public Type TermPage { get; set; }
}