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: PathBufOriginal source path
dest_filename: StringDestination filename (e.g., “index.html” or “my-entry.html”)
title: StringPage title
rendered_body: StringRendered content in the output format (body only, no wrapper)
markdown_body: StringOriginal 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: boolWhether this is the root index
description: Option<String>Page description (from frontmatter description)
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_document → created → updated,
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: PageLayoutWhich 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.
Override title shown in navigation (from frontmatter nav_title)
Sort order among siblings in navigation (from frontmatter nav_order)
Whether to hide this page from the navigation tree
hide_from_feed: boolWhether 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: StringThe 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: boolWhether 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
impl PublishedPage
Sourcepub fn published_date(&self) -> Option<&str>
pub fn published_date(&self) -> Option<&str>
When the entry is of, as its vault wrote it:
date_of_document → created → updated.
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 — updated → created — 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.
Sourcepub fn modified_date(&self) -> Option<&str>
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
impl Clone for PublishedPage
Source§fn clone(&self) -> PublishedPage
fn clone(&self) -> PublishedPage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more