Skip to main content

PublishedPage

Struct PublishedPage 

Source
pub struct PublishedPage {
Show 28 fields pub source_path: PathBuf, pub dest_filename: String, pub title: String, pub rendered_body: String, pub markdown_body: String, pub contents_links: Vec<NavLink>, pub parent_link: Option<NavLink>, pub is_root: bool, pub description: Option<String>, pub author: Option<String>, pub created: Option<String>, pub updated: Option<String>, pub date_of_document: Option<String>, pub group_keys: Vec<String>, pub attachments: Vec<String>, pub styles: Vec<String>, pub scripts: Vec<String>, pub layout: PageLayout, pub shell: Option<String>, pub lang: Option<String>, pub nav_title: Option<String>, pub nav_order: Option<i32>, pub hide_from_nav: bool, pub hide_from_feed: bool, pub id: Option<String>, pub source_markdown: String, pub headings: Vec<Heading>, pub toc: bool,
}
Expand description

A processed file ready for publishing.

Fields§

§source_path: PathBuf

Original source path

§dest_filename: String

Destination filename (e.g., “index.html” or “my-entry.html”)

§title: String

Page title

§rendered_body: String

Rendered content in the output format (body only, no wrapper)

§markdown_body: String

Original markdown body

§contents_links: Vec<NavLink>

Navigation links to children (from contents property)

§parent_link: Option<NavLink>

Navigation link to parent (from part_of property)

§is_root: bool

Whether this is the root index

§description: Option<String>

Page description (from frontmatter description)

§author: Option<String>

Page author (from frontmatter author)

§created: Option<String>

Creation date (from frontmatter created)

§updated: Option<String>

Last update date (from frontmatter updated)

§date_of_document: Option<String>

The date the document is about, as opposed to when its file was made (from frontmatter date_of_document). First link in the date chain a grouped arrangement sorts by: date_of_documentcreatedupdated, the same chain a grouped view is cut by.

§group_keys: Vec<String>

The values this page groups under in a grouped arrangement — the date cut to the view’s grain, or the grouping field’s values. Empty for a containment arrangement, or for a page carrying nothing to group by (which lands it in the “ungrouped” bucket rather than dropping it).

§attachments: Vec<String>

Attachment paths (from frontmatter attachments)

§styles: Vec<String>

Stylesheets this page pulls in (from frontmatter styles), as paths below the site root — already resolved against the document that named them, so ../theme.css and /theme.css both arrive as theme.css.

Emitted as <link rel="stylesheet"> after the site stylesheet, rebased to the page’s own depth. The file itself is the caller’s to copy, the same way an attachments entry is.

§scripts: Vec<String>

Scripts this page pulls in (from frontmatter scripts), resolved and copied exactly like styles and emitted as <script defer src="…"> after the built-in interactivity script.

§layout: PageLayout

Which shell wraps this page (from frontmatter layout).

§shell: Option<String>

The shell template this page asked for by name (from frontmatter shell), as the vault-relative path it was written as — the key into SiteOptions::templates, since the render crate reads no files.

None for a page that takes the site’s own shell, which is every page that does not name one — and every bare/verbatim page, which take no shell at all and so are never recorded as wanting one.

§lang: Option<String>

The language this page is written in (from frontmatter lang), as a BCP 47 tag. None takes the site’s (SiteOptions::lang), which is the answer for every page in an archive that is written in one language.

An archive is not obliged to be. A letter quoted in full, a page of translations, an entry someone wrote in their first language: each is a document whose <html lang="…"> is a fact about the document, and a site-wide tag makes it a lie that screen readers and search engines both act on.

§nav_title: Option<String>

Override title shown in navigation (from frontmatter nav_title)

§nav_order: Option<i32>

Sort order among siblings in navigation (from frontmatter nav_order)

§hide_from_nav: bool

Whether to hide this page from the navigation tree

§hide_from_feed: bool

Whether to hide this page from RSS/Atom feeds

§id: Option<String>

The source document’s own identifier, read from frontmatter id — which is prov’s registry id for the file.

Carried through the render untouched: nothing here reads it. It is here because a caller that mints permalinks, builds an index, or addresses the published object by identity needs to know which page each id belongs to, and the render is the only place that pairing exists.

§source_markdown: String

The audience-scoped markdown source (frontmatter + visibility-filtered body) uploaded as a sibling so the server can serve ?content/?json.

§headings: Vec<Heading>

The headings of the rendered body, in document order, each with the id the render gave it — what the toc shell slot and a template’s headings list are made of. See crate::headings.

Empty for a verbatim page, whose body nothing reads.

§toc: bool

Whether the built-in shell writes this page’s outline (frontmatter toc, true unless the page says toc: false). Turns off the toc slot only: the headings keep their anchors and a template still sees them.

Implementations§

Source§

impl PublishedPage

Source

pub fn published_date(&self) -> Option<&str>

When the entry is of, as its vault wrote it: date_of_documentcreatedupdated.

The one chain, so a site cannot disagree with itself. A grouped arrangement files and orders entries by this (it is the chain prov’s views cuts by), and the feeds, the sitemap and article:published_time used to answer a different question — updatedcreated — so a journal of scanned letters, whose date_of_document is the year it was written and whose created is the day it was scanned, syndicated in scanning order while its own front page listed it by letter date.

Source

pub fn modified_date(&self) -> Option<&str>

When the entry last changed: updated, else whatever published_date found.

What a sitemap’s lastmod and a feed entry’s <updated> mean, as against the <published> above them.

Trait Implementations§

Source§

impl Clone for PublishedPage

Source§

fn clone(&self) -> PublishedPage

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 PublishedPage

Source§

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

Formats the value using the given formatter. 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.