pub struct PathRewrite {
pub root: Option<String>,
pub base: Option<String>,
pub pages: BTreeMap<String, String>,
pub attributes: Option<Vec<String>>,
}Expand description
html.pathRewrite: the URLs of a document’s attributes as a site serves them, as
md.pathRewrite does for Markdown: relative ones resolved against the file’s path and
made root-relative, every root-relative one under base, and links to a page’s file
turned into its URL.
Fields§
§root: Option<String>The directory URLs count from, as the file’s path spells it; the path’s own starting point when left out.
base: Option<String>The URL the site is served at, such as /docs, put before every root-relative URL
once.
pages: BTreeMap<String, String>Files, relative to root, to the URL of their page, such as
{"guide.html": "/guide/"}; an href naming one takes it.
attributes: Option<Vec<String>>The attributes whose URLs are rewritten; href, src, srcset and poster when
left out.
Trait Implementations§
Source§impl Clone for PathRewrite
impl Clone for PathRewrite
Source§impl Debug for PathRewrite
impl Debug for PathRewrite
Source§impl Default for PathRewrite
impl Default for PathRewrite
Source§impl<'de> Deserialize<'de> for PathRewritewhere
PathRewrite: Default,
impl<'de> Deserialize<'de> for PathRewritewhere
PathRewrite: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Plugin for PathRewrite
impl Plugin for PathRewrite
Source§impl Transform for PathRewrite
impl Transform for PathRewrite
fn input(&self) -> TreeKind
fn output(&self) -> TreeKind
fn run<'a>( &self, tree: Tree<'a>, file: &mut File, alloc: &'a Allocator, ) -> Result<Tree<'a>, Error>
Source§fn start<'a>(
&self,
tree: Tree<'a>,
file: &mut File,
alloc: &'a Bump,
) -> Result<Step<'a>, Error>
fn start<'a>( &self, tree: Tree<'a>, file: &mut File, alloc: &'a Bump, ) -> Result<Step<'a>, Error>
Start the stage: a finished tree, or a job when its work is asynchronous.
Source§fn host(&self) -> Option<u32>
fn host(&self) -> Option<u32>
The id of the binding function this stage stands for, which takes and returns
whatever tree reaches it;
None for a stage the crate runs.Source§fn html_writer(&self, _target: HtmlTarget) -> Option<Box<dyn HtmlWriter>>
fn html_writer(&self, _target: HtmlTarget) -> Option<Box<dyn HtmlWriter>>
Something that writes, from this stage’s input, the HTML a compiler aiming at
target would write from its output, when the stage can skip building that tree.Auto Trait Implementations§
impl Freeze for PathRewrite
impl RefUnwindSafe for PathRewrite
impl Send for PathRewrite
impl Sync for PathRewrite
impl Unpin for PathRewrite
impl UnsafeUnpin for PathRewrite
impl UnwindSafe for PathRewrite
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
Mutably borrows from an owned value. Read more