pub struct HeadMeta {
pub declared: Vec<(String, Vec<String>)>,
pub title: Option<String>,
pub description: Option<String>,
pub author: Option<String>,
pub category: Option<String>,
pub tags: Vec<String>,
pub published: Option<Value>,
pub modified: Option<Value>,
}Expand description
What a document declares about itself, in a standard
vocabulary its format provides — HTML’s <head> (the meta
name/property pairs, title, the lang attribute, the
canonical link, rel="tag" links) and a schema.org JSON-LD
block. Two layers: every declaration lands verbatim under
::::name (::::description, ::::og:type,
::::article:section, ::::schema:@type), so nothing a page
says is lost; and the standard vocabularies feed a curated
core — the tags (keywords, article:tag, rel=tag, JSON-LD
keywords) become traits on the document and ::tags, the
one classification (article:section / articleSection)
becomes ::category and a trait too, description, author,
and the published / modified instants. Declared identity
only: a format adapter reads a cited vocabulary, never a class
name or a layout.
Fields§
§declared: Vec<(String, Vec<String>)>Every declaration, name → values, in document order; a repeated name accumulates.
title: Option<String>§description: Option<String>§category: Option<String>The one classification (a section of the site, a category).
The tags, as written, first appearance wins.
published: Option<Value>§modified: Option<Value>Implementations§
Source§impl HeadMeta
impl HeadMeta
Sourcepub fn declare(&mut self, name: &str, value: &str)
pub fn declare(&mut self, name: &str, value: &str)
Record a declaration verbatim (the lossless layer).
Sourcepub fn declared_value(&self, name: &str) -> Option<Value>
pub fn declared_value(&self, name: &str) -> Option<Value>
A declaration’s value: the string when declared once, the list when repeated.
Sourcepub fn trait_name(s: &str) -> String
pub fn trait_name(s: &str) -> String
The trait spelling of a tag or category: as declared, case
kept, with runs of anything a name cannot carry (spaces,
slashes, parentheses) collapsed to one dash — Execution Model is <tag:Execution-Model>, now() is <tag:now>.