Skip to main content

ShellSlots

Struct ShellSlots 

Source
pub struct ShellSlots {
Show 15 fields pub lang: String, pub document_title: String, pub site_title: String, pub body_class: String, pub root_prefix: String, pub head: String, pub site_nav: String, pub breadcrumbs: String, pub toc: String, pub site_header: String, pub content: String, pub pager: String, pub site_footer: String, pub footer: String, pub scripts: String,
}
Expand description

The named values a shell template is filled with.

Text fields hold their unescaped text; escaping happens where the slot is filled, so a value is escaped exactly once no matter which shell renders it.

Fields§

§lang: String

{{lang}} — the document language, for <html lang="…">.

§document_title: String

{{document_title}} — the <title> text: "Entry - Site", or just the site’s name on the page that is the site.

§site_title: String

{{site_title}} — the site’s name on its own.

§body_class: String

{{body_class}} — the class list for <body>, to be written inside class="…". Empty when the page has no site nav.

§root_prefix: String

{{root_prefix}} — the path from this page back up to the site root: ../ per level of depth, empty at the root. Every prefixed href in head and site_nav was computed from it; a template writing its own <a href="{{root_prefix}}index.html"> or <img src="{{root_prefix}}logo.svg"> needs the same value.

§head: String

{{{head}}} — stylesheet link, favicon link, SEO meta, feed links and the page’s own styles:, as a newline-separated run of tags indented four spaces. Does not include <title>, which is its own slot.

§site_nav: String

{{{site_nav}}} — the site navigation: the mobile bar with its menu button, then the sidebar with the masthead and the tree. Empty when the site has no nav tree.

§breadcrumbs: String

{{{breadcrumbs}}} — the breadcrumb trail for this page.

§toc: String

{{{toc}}} — the page’s outline, a <nav class="toc"> of its h2h3 headings. Empty when there are fewer than two, or the page said toc: false.

§site_header: String

{{{site_header}}} — the site’s header document, rendered for this page. Empty when the site declares none.

§content: String

{{{content}}} — the rendered body, with its links already rewritten.

§pager: String

{{{pager}}}<nav class="pager"> linking the previous and next page in the nav’s reading order. Empty for a page the nav does not hold, or a site of one page.

§site_footer: String

{{{site_footer}}} — the site’s footer document, rendered for this page. Empty when the site declares none.

§footer: String

{{{footer}}} — the built-in attribution footer.

§scripts: String

{{{scripts}}} — the built-in interactivity script and the page’s own scripts:, as a newline-separated run of tags indented four spaces.

Trait Implementations§

Source§

impl Clone for ShellSlots

Source§

fn clone(&self) -> ShellSlots

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShellSlots

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShellSlots

Source§

fn default() -> ShellSlots

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.