pub struct FrontmatterTemplating;Expand description
Helper functions for frontmatter templating.
Implementations§
Source§impl FrontmatterTemplating
impl FrontmatterTemplating
Sourcepub fn build_template_context(project_config: &ProjectConfig) -> TeraContext
pub fn build_template_context(project_config: &ProjectConfig) -> TeraContext
Sourcepub fn apply_templating(
content: &str,
project_config: &ProjectConfig,
template_renderer: &mut TemplateRenderer,
file_path: &Path,
) -> Result<String>
pub fn apply_templating( content: &str, project_config: &ProjectConfig, template_renderer: &mut TemplateRenderer, file_path: &Path, ) -> Result<String>
Apply Tera templating to frontmatter content.
Always renders the content as a template, even if no template syntax is present.
§Arguments
content- The frontmatter content to templateproject_config- Project configuration for template variablestemplate_renderer- Template renderer to usefile_path- Path to file for error reporting
§Returns
Result<String>- Templated content or error
Sourcepub fn build_template_context_from_variant_inputs(
variant_inputs: &Value,
) -> TeraContext
pub fn build_template_context_from_variant_inputs( variant_inputs: &Value, ) -> TeraContext
Auto Trait Implementations§
impl Freeze for FrontmatterTemplating
impl RefUnwindSafe for FrontmatterTemplating
impl Send for FrontmatterTemplating
impl Sync for FrontmatterTemplating
impl Unpin for FrontmatterTemplating
impl UnwindSafe for FrontmatterTemplating
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more