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

IHasStructuredData Pennington.StructuredData

Capability interface for an IFrontMatter type that can describe its own schema.org JSON-LD. Templates that render content (DocSite, BlogSite, custom hosts) check for this capability and emit the returned entities through <StructuredData>.

Methods

GetStructuredData

#
public IEnumerable<JsonLdEntity> GetStructuredData(StructuredDataContext context)

Returns the schema.org entities to emit on the page. Implementations typically yield one Article/Recipe/Product/etc. built from front matter values, plus the CanonicalUrl the template supplies.

Parameters

context StructuredDataContext

Returns

IEnumerable<JsonLdEntity>

Pennington.StructuredData.IHasStructuredData

namespace Pennington.StructuredData;

/// Capability interface for an IFrontMatter type that can describe its own schema.org JSON-LD. Templates that render content (DocSite, BlogSite, custom hosts) check for this capability and emit the returned entities through <StructuredData>.
public interface IHasStructuredData
{
    /// Returns the schema.org entities to emit on the page. Implementations typically yield one Article/Recipe/Product/etc. built from front matter values, plus the CanonicalUrl the template supplies.
    
public IEnumerable<JsonLdEntity> GetStructuredData(StructuredDataContext context)
; }