SocialCardRequest
Pennington.SocialCards
Everything Render needs to draw a card for one page: the page's resolved metadata plus the site identity and the card's own absolute URL.
Properties
CanonicalPathUrlPath- Canonical path of the page the card represents.
CardUrlstring- The card's own URL — absolute when a canonical base URL is configured, else root-relative.
DateDateTime?- Publication date, when set.
Descriptionstring- Page description, when the front matter supplies one.
Heightint- Requested card height in pixels.
Localestring- Locale code of the page, or
nullfor the default locale. MetadataIFrontMatter- The page's full typed front matter, so a renderer can read tags, author, and other capabilities.
SiteDescriptionstring- Site description, available for fallback copy.
SiteTitlestring- Site title, for branding the card.
Titlestring- Page title.
Widthint- Requested card width in pixels.
Constructors
SocialCardRequest
#public SocialCardRequest(string Title, string Description, DateTime? Date, UrlPath CanonicalPath, string CardUrl, string Locale, string SiteTitle, string SiteDescription, IFrontMatter Metadata, int Width, int Height)
Everything Render needs to draw a card for one page: the page's resolved metadata plus the site identity and the card's own absolute URL.
Parameters
Titlestring- Page title.
Descriptionstring- Page description, when the front matter supplies one.
DateDateTime?- Publication date, when set.
CanonicalPathUrlPath- Canonical path of the page the card represents.
CardUrlstring- The card's own URL — absolute when a canonical base URL is configured, else root-relative.
Localestring- Locale code of the page, or
nullfor the default locale. SiteTitlestring- Site title, for branding the card.
SiteDescriptionstring- Site description, available for fallback copy.
MetadataIFrontMatter- The page's full typed front matter, so a renderer can read tags, author, and other capabilities.
Widthint- Requested card width in pixels.
Heightint- Requested card height in pixels.
Pennington.SocialCards.SocialCardRequest
namespace Pennington.SocialCards;
/// Everything Render needs to draw a card for one page: the page's resolved metadata plus the site identity and the card's own absolute URL.
public record SocialCardRequest
{
/// Canonical path of the page the card represents.
public UrlPath CanonicalPath { get; set; }
/// The card's own URL — absolute when a canonical base URL is configured, else root-relative.
public string CardUrl { get; set; }
/// Publication date, when set.
public DateTime? Date { get; set; }
/// Page description, when the front matter supplies one.
public string Description { get; set; }
/// Requested card height in pixels.
public int Height { get; set; }
/// Locale code of the page, or null for the default locale.
public string Locale { get; set; }
/// The page's full typed front matter, so a renderer can read tags, author, and other capabilities.
public IFrontMatter Metadata { get; set; }
/// Site description, available for fallback copy.
public string SiteDescription { get; set; }
/// Site title, for branding the card.
public string SiteTitle { get; set; }
/// Everything Render needs to draw a card for one page: the page's resolved metadata plus the site identity and the card's own absolute URL.
public SocialCardRequest(string Title, string Description, DateTime? Date, UrlPath CanonicalPath, string CardUrl, string Locale, string SiteTitle, string SiteDescription, IFrontMatter Metadata, int Width, int Height)
;
/// Page title.
public string Title { get; set; }
/// Requested card width in pixels.
public int Width { get; set; }
}