pub struct FrontMatter {
pub title: Option<String>,
pub description: Option<String>,
pub layout: Option<String>,
pub tags: Vec<String>,
pub sidebar: Option<bool>,
pub sidebar_order: Option<i32>,
pub custom: HashMap<String, NargoValue>,
}Expand description
前置元数据(Front Matter)
Fields§
§title: Option<String>页面标题
description: Option<String>页面描述
layout: Option<String>页面布局
页面标签
是否在侧边栏中隐藏
侧边栏顺序
custom: HashMap<String, NargoValue>自定义元数据
Implementations§
Source§impl FrontMatter
impl FrontMatter
Sourcepub fn new() -> FrontMatter
pub fn new() -> FrontMatter
创建新的前置元数据
Sourcepub fn with_title(self, title: String) -> FrontMatter
pub fn with_title(self, title: String) -> FrontMatter
设置标题
Sourcepub fn with_description(self, description: String) -> FrontMatter
pub fn with_description(self, description: String) -> FrontMatter
设置描述
Sourcepub fn with_layout(self, layout: String) -> FrontMatter
pub fn with_layout(self, layout: String) -> FrontMatter
设置布局
Sourcepub fn add_tag(self, tag: String) -> FrontMatter
pub fn add_tag(self, tag: String) -> FrontMatter
添加标签
Trait Implementations§
Source§impl Clone for FrontMatter
impl Clone for FrontMatter
Source§fn clone(&self) -> FrontMatter
fn clone(&self) -> FrontMatter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrontMatter
impl Debug for FrontMatter
Source§impl Default for FrontMatter
impl Default for FrontMatter
Source§fn default() -> FrontMatter
fn default() -> FrontMatter
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FrontMatter
impl<'de> Deserialize<'de> for FrontMatter
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FrontMatter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FrontMatter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FrontMatter
impl PartialEq for FrontMatter
Source§impl Serialize for FrontMatter
impl Serialize for FrontMatter
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for FrontMatter
Auto Trait Implementations§
impl Freeze for FrontMatter
impl RefUnwindSafe for FrontMatter
impl Send for FrontMatter
impl Sync for FrontMatter
impl Unpin for FrontMatter
impl UnsafeUnpin for FrontMatter
impl UnwindSafe for FrontMatter
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