pub struct HeroShortcode {
pub image: Option<Url>,
pub attrs: String,
pub classes: String,
pub overlay: Vec<Block>,
pub overlay_text: String,
pub width: Option<String>,
}Expand description
Arguments for Shortcode::Hero.
Fields§
§image: Option<Url>Image source URL. None if neither the image attribute nor the
first body line provided one — the renderer emits a section with
no <img> in that case. Flows through resolver before rendering.
attrs: StringPipe-suffix media attributes verbatim (e.g. “cover top”, “1.5:1 contain”). Empty if no pipe in the source.
classes: StringExtra CSS classes for the wrapping <section> (from {.foo .bar}).
overlay: Vec<Block>Parsed block content for the overlay. Phase 4 PR4.5 (2026-05-28)
promoted this from overlay_markdown: String to overlay: Vec<Block>
(fully-typed AST). Nested shortcodes inside the overlay
(::::buttons inside :::hero) extract through
crate::ast::parser::parse recursion in
[crate::ast::shortcode_extract::parse_hero].
overlay_text: StringPlain-text overlay source for downstream OG-fallback extraction.
PR4.5 (2026-05-28): captured at parse time alongside the typed
overlay because crate::build::page::meta::extract_description
(the homepage-hero rung in the description chain) operates on
markdown source — round-tripping Vec<Block> to markdown would
invite drift. The renderer uses overlay for HTML; downstream
consumers read overlay_text for description-chain extraction.
Empty when the author wrote no overlay body.
TODO(phase4-cleanup): replace with a Vecto_plain_text(blocks: &[Block]) -> String helper in moss-core
- consume
overlaydirectly inmeta.rs::extract_description, deleting this field. Carrying bothoverlay: Vec<Block>ANDoverlay_text: Stringmakes the AST non-canonical (which is the source of truth?); per cross-SSG research, lossy or duplicate state is Gatsby’s mistake. This is transitional — flag if it survives past PR7a. (Architecture review caveat 2026-05-28.)
width: Option<String>Spec § P9 width attribute: body | wide | page | screen (with
full aliased to screen). None means the author did not set
a width — the emitter omits data-width so the HTML stays sparse.
Trait Implementations§
Source§impl Clone for HeroShortcode
impl Clone for HeroShortcode
Source§fn clone(&self) -> HeroShortcode
fn clone(&self) -> HeroShortcode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HeroShortcode
impl Debug for HeroShortcode
Source§impl Default for HeroShortcode
impl Default for HeroShortcode
Source§fn default() -> HeroShortcode
fn default() -> HeroShortcode
Source§impl<'de> Deserialize<'de> for HeroShortcode
impl<'de> Deserialize<'de> for HeroShortcode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for HeroShortcode
impl PartialEq for HeroShortcode
Source§fn eq(&self, other: &HeroShortcode) -> bool
fn eq(&self, other: &HeroShortcode) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for HeroShortcode
impl Serialize for HeroShortcode
impl Eq for HeroShortcode
impl StructuralPartialEq for HeroShortcode
Auto Trait Implementations§
impl Freeze for HeroShortcode
impl RefUnwindSafe for HeroShortcode
impl Send for HeroShortcode
impl Sync for HeroShortcode
impl Unpin for HeroShortcode
impl UnsafeUnpin for HeroShortcode
impl UnwindSafe for HeroShortcode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.