Struct gutenberg::SectionFrontMatter
[−]
[src]
pub struct SectionFrontMatter { pub title: Option<String>, pub description: Option<String>, pub sort_by: Option<SortBy>, pub template: Option<String>, pub paginate_by: Option<usize>, pub paginate_path: Option<String>, pub insert_anchor: Option<InsertAnchor>, pub render: Option<bool>, pub extra: Option<HashMap<String, Value>>, }
The front matter of every section
Fields
title: Option<String>
description: Option<String>
Description in that appears when linked, e.g. on twitter
sort_by: Option<SortBy>
Whether to sort by "date", "order" or "none". Defaults to none
.
template: Option<String>
Optional template, if we want to specify which template to render for that page
paginate_by: Option<usize>
How many pages to be displayed per paginated page. No pagination will happen if this isn't set
paginate_path: Option<String>
Path to be used by pagination: the page number will be appended after it. Defaults to page
.
insert_anchor: Option<InsertAnchor>
Whether to insert a link for each header like in Github READMEs. Defaults to false
The default template can be overridden by creating a anchor-link.html
template and CSS will need to be
written if you turn that on.
render: Option<bool>
Whether to render that section or not. Defaults to true
.
Useful when the section is only there to organize things but is not meant
to be used directly, like a posts section in a personal site
extra: Option<HashMap<String, Value>>
Any extra parameter present in the front matter
Methods
impl SectionFrontMatter
[src]
fn parse(toml: &str) -> Result<SectionFrontMatter>
fn sort_by(&self) -> SortBy
Returns the current sorting method, defaults to None
(== no sorting)
fn is_paginated(&self) -> bool
Only applies to section, whether it is paginated or not.
fn should_render(&self) -> bool
Trait Implementations
impl Debug for SectionFrontMatter
[src]
impl Clone for SectionFrontMatter
[src]
fn clone(&self) -> SectionFrontMatter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for SectionFrontMatter
[src]
fn eq(&self, __arg_0: &SectionFrontMatter) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SectionFrontMatter) -> bool
This method tests for !=
.
impl Default for SectionFrontMatter
[src]
fn default() -> SectionFrontMatter
Returns the "default value" for a type. Read more