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
BaseUrlstring- Base URL the taxonomy mounts under. The index lives at this URL; per-term pages at
{BaseUrl}/{slug}/. Required. EmitCrossReferencesbool- Whether to publish a cross-reference per term (e.g.
tag-csharp). Defaulttrue. IndexPageType- Razor component that renders the index at
BaseUrl. Receives the full term list as aTermsparameter. Required. LabelForFunc<TKey, string>- Optional human-readable label override. Default returns the key's string form.
SearchPriorityint- Search-index priority for the discovered routes. Higher ranks first. Default
10. SectionLabelstring- Section label applied to the navigation entries. Defaults to the last segment of
BaseUrlwith the first letter uppercased. SelectKeyFunc<TFrontMatter, TKey>- Single-valued projection. Set this OR
SelectKeys— exactly one is required. Items whose projection returnsnull(whenTKeyis nullable) or the default value are skipped. SelectKeysFunc<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. SlugForFunc<TKey, string>- Slug encoder. Default lowercases the key's string form and replaces whitespace with hyphens; URL-encodes any remaining unsafe characters.
TermPageType- Razor component that renders each per-term page at
{BaseUrl}/{slug}/. Receives the matchingTaxonomyTermas aTermparameter. 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; }
}