Struct hugo_to_json::page_index::PageIndex [−][src]
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 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]
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>
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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for PageIndex
[src]
Auto Trait Implementations
impl RefUnwindSafe for PageIndex
impl Send for PageIndex
impl Sync for PageIndex
impl Unpin for PageIndex
impl UnwindSafe for PageIndex
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,