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

IHeadContributor Pennington.Head

Contributes tags to the document <head>. Every contributor feeds a single HeadBuilder; the composed result is reconciled into the DOM once by the head composition rewriter. Contributors never touch the DOM directly — they emit typed HeadTags, and dedup/ordering is handled centrally.

Properties

Order int
Ascending priority (use the HeadOrder bands). Contributors run lowest-first, and on a HeadTagKey collision the lowest order wins.

Methods

ContributeAsync

#
public Task ContributeAsync(HeadContext context, HeadBuilder head)

Pushes tags into the builder for this request.

Parameters

context HeadContext
head HeadBuilder

Returns

Task

ShouldContribute

#
public bool ShouldContribute(HeadContext context)

Cheap gate. Return false to skip ContributeAsync entirely.

Parameters

context HeadContext

Returns

bool

Pennington.Head.IHeadContributor

namespace Pennington.Head;

/// Contributes tags to the document <head>. Every contributor feeds a single HeadBuilder; the composed result is reconciled into the DOM once by the head composition rewriter. Contributors never touch the DOM directly — they emit typed HeadTags, and dedup/ordering is handled centrally.
public interface IHeadContributor
{
    /// Pushes tags into the builder for this request.
    
public Task ContributeAsync(HeadContext context, HeadBuilder head)
; /// Ascending priority (use the HeadOrder bands). Contributors run lowest-first, and on a HeadTagKey collision the lowest order wins.
public int Order { get; }
/// Cheap gate. Return false to skip ContributeAsync entirely.
public bool ShouldContribute(HeadContext context)
; }