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

HeadBuilder Pennington.Head

Collects HeadTags from every contributor. Keyed tags deduplicate by HeadTagKey (first add at a key wins; later same-key adds are dropped) while preserving first-seen order; keyless tags (added via AddRepeatable) always append.

Methods

Add

#
public HeadBuilder Add(HeadTagKey key, HeadTag tag)

Adds a tag under an explicit dedup key; the first add at a key wins.

Parameters

key HeadTagKey
tag HeadTag

Returns

HeadBuilder

AddRepeatable

#
public HeadBuilder AddRepeatable(HeadTag tag)

Adds a repeatable tag (hreflang, JSON-LD, preload) with no deduplication.

Parameters

tag HeadTag

Returns

HeadBuilder

Build

#
public IReadOnlyList<HeadEntry> Build()

The composed entries: keyed tags first (first-seen order), then keyless tags (append order).

Returns

IReadOnlyList<HeadEntry>
#
public HeadBuilder Link(string rel, string href)

Sets a singleton link (e.g. canonical), deduplicated on its rel.

Parameters

rel string
href string

Returns

HeadBuilder

Meta

#
public HeadBuilder Meta(string name, string content)

Sets a named meta tag, deduplicated on its name.

Parameters

name string
content string

Returns

HeadBuilder

Property

#
public HeadBuilder Property(string property, string content)

Sets an OpenGraph/property meta tag, deduplicated on its property.

Parameters

property string
content string

Returns

HeadBuilder

Title

#
public HeadBuilder Title(string text)

Sets the document title (deduplicated to one).

Parameters

text string

Returns

HeadBuilder

Pennington.Head.HeadBuilder

namespace Pennington.Head;

/// Collects HeadTags from every contributor. Keyed tags deduplicate by HeadTagKey (first add at a key wins; later same-key adds are dropped) while preserving first-seen order; keyless tags (added via AddRepeatable) always append.
public class HeadBuilder
{
    /// Adds a tag under an explicit dedup key; the first add at a key wins.
    
public HeadBuilder Add(HeadTagKey key, HeadTag tag)
; /// Adds a repeatable tag (hreflang, JSON-LD, preload) with no deduplication.
public HeadBuilder AddRepeatable(HeadTag tag)
; /// The composed entries: keyed tags first (first-seen order), then keyless tags (append order).
public IReadOnlyList<HeadEntry> Build()
; /// Sets a singleton link (e.g. canonical), deduplicated on its rel.
public HeadBuilder Link(string rel, string href)
; /// Sets a named meta tag, deduplicated on its name.
public HeadBuilder Meta(string name, string content)
; /// Sets an OpenGraph/property meta tag, deduplicated on its property.
public HeadBuilder Property(string property, string content)
; /// Sets the document title (deduplicated to one).
public HeadBuilder Title(string text)
; }