Struct hugo_to_json::page_index::PageIndex[][src]

pub struct PageIndex {
    pub title: String,
    pub href: String,
    pub date: String,
    pub content: String,
    pub description: String,
    pub categories: Vec<String>,
    pub series: Vec<String>,
    pub tags: Vec<String>,
    pub keywords: Vec<String>,
    pub draft: bool,
}

Represents a summary of an individual document/post in the contents directory.

Fields

title: String

Title of the document from frontmatter

href: String

href of the document, constructed from either frontmatter if it exists or relative path info

date: String

date of the document from frontmatter

content: String

contents of the document with markdown stripped away

description: String

Description of the document from frontmatter

categories: Vec<String>

Categories of the document from frontmatter

series: Vec<String>

Series of the document from frontmatter

tags: Vec<String>

Tags of the document from frontmatter

keywords: Vec<String>

Keywords of the document from frontmatter

draft: bool

Is this a draft?

Implementations

impl PageIndex[src]

pub fn new(
    title: Option<&str>,
    slug: Option<&str>,
    date: Option<&str>,
    description: Option<&str>,
    categories: Vec<String>,
    series: Vec<String>,
    tags: Vec<String>,
    keywords: Vec<String>,
    content: String,
    file_location: &FileLocation,
    url: Option<&str>,
    draft: bool
) -> Result<Self, OperationResult>
[src]

Creates a new Page Index from the parameters read from the frontmatter of the document. It will also try and construct a href to the document using either data in the frontmatter or based on the file location.

Errors

This will fail if a document doesn’t contain a title or a date or they can’t be read from the frontmatter.

Trait Implementations

impl Debug for PageIndex[src]

impl PartialEq<PageIndex> for PageIndex[src]

impl Serialize for PageIndex[src]

impl StructuralPartialEq for PageIndex[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> From<T> for T[src]

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

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.