Struct gutenberg::PageFrontMatter
[−]
[src]
pub struct PageFrontMatter { pub title: Option<String>, pub description: Option<String>, pub date: Option<String>, pub slug: Option<String>, pub url: Option<String>, pub tags: Option<Vec<String>>, pub category: Option<String>, pub order: Option<usize>, pub aliases: Option<Vec<String>>, pub template: Option<String>, pub extra: Option<HashMap<String, Value>>, }
The front matter of every page
Fields
title: Option<String>
description: Option<String>
Description in that appears when linked, e.g. on twitter
date: Option<String>
Date if we want to order pages (ie blog post)
slug: Option<String>
The page slug. Will be used instead of the filename if present Can't be an empty string if present
url: Option<String>
The url the page appears at, overrides the slug if set in the front-matter otherwise is set after parsing front matter and sections Can't be an empty string if present
Tags, not to be confused with categories
category: Option<String>
Only one category allowed. Can't be an empty string if present
order: Option<usize>
Integer to use to order content. Lowest is at the bottom, highest first
aliases: Option<Vec<String>>
All aliases for that page. Gutenberg will create HTML templates that will
template: Option<String>
Specify a template different from page.html
to use for that page
extra: Option<HashMap<String, Value>>
Any extra parameter present in the front matter
Methods
impl PageFrontMatter
[src]
fn parse(toml: &str) -> Result<PageFrontMatter>
fn date(&self) -> Option<NaiveDateTime>
Converts the date in the front matter, which can be in 2 formats, into a NaiveDateTime
fn order(&self) -> usize
Trait Implementations
impl Debug for PageFrontMatter
[src]
impl Clone for PageFrontMatter
[src]
fn clone(&self) -> PageFrontMatter
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 PageFrontMatter
[src]
fn eq(&self, __arg_0: &PageFrontMatter) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PageFrontMatter) -> bool
This method tests for !=
.
impl Default for PageFrontMatter
[src]
fn default() -> PageFrontMatter
Returns the "default value" for a type. Read more