[][src]Struct mercurius::FrontMatter

pub struct FrontMatter {
    pub title: String,
    pub create_date: ReadableDate,
    pub last_update: Option<ReadableDate>,
    pub lang: Lang,
    pub description: Option<String>,
    pub tags: Option<Vec<String>>,
    pub status: Status,
    pub render: Render,
    pub banner: Banner,
}

The frontmatter in a Markdown file.

Note, mercurius only parses the frontmatter, it would never modify the parsing result itself. Functionalities below is implemented by another binary package named quatrain.

Fields

title: String

The title of the current file.

HTML Rendering

  1. Title would be used in the <title> tag.
  2. It would also be prepended as an <h1> at the front of the article.
create_date: ReadableDate

The create date of the file.

This should be the exact date the file was created, even empty.

last_update: Option<ReadableDate>

The last modified date of the file.

Formatting or rewriting should not be taken into account.

HTML Render

  1. This field is now used to calculate the Outdate Info.
lang: Lang

Main language of the file.

This language should be the one used most in this file. Use the word Apple to refer that language, e.g., 林檎.

description: Option<String>

The description of the file.

Currently this field will not be used in any place. This is reserved for future usage, e.g., the <meta> tag.

tags: Option<Vec<String>>

Tagging the file.

Currently this field will not be used in any place. This is reserved for future usage, e.g., filtering by tags.

status: Status

The status of the file.

Currently this field will not be used in any place. This is reserved for future usage, e.g., conditional rendering or publishing.

render: Render

Control the rendering behavior.

banner: Banner

The banner of the file.

Trait Implementations

impl Clone for FrontMatter[src]

impl Debug for FrontMatter[src]

impl Default for FrontMatter[src]

impl<'de> Deserialize<'de> for FrontMatter[src]

impl PartialEq<FrontMatter> for FrontMatter[src]

impl Serialize for FrontMatter[src]

impl StructuralPartialEq for FrontMatter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.