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
Orderint- Ascending priority (use the
HeadOrderbands). Contributors run lowest-first, and on aHeadTagKeycollision the lowest order wins.
Methods
ContributeAsync
#public Task ContributeAsync(HeadContext context, HeadBuilder head)
Pushes tags into the builder for this request.
Parameters
contextHeadContextheadHeadBuilder
Returns
TaskShouldContribute
#public bool ShouldContribute(HeadContext context)
Cheap gate. Return false to skip ContributeAsync entirely.
Parameters
contextHeadContext
Returns
boolPennington.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)
;
}