Struct futhorc::post::Post[][src]

pub struct Post {
    pub file_path: PathBuf,
    pub url: UrlBuf,
    pub title: String,
    pub date: String,
    pub body: String,
    pub tags: HashSet<Tag>,
}

Represents a blog post.

Fields

file_path: PathBuf

The output path where the final post file will be rendered.

url: UrlBuf

The address for the rendered post.

title: String

The title of the post.

date: String

The date of the post.

body: String

The body of the post.

tags: HashSet<Tag>

The tags associated with the post.

Implementations

impl Post[src]

pub fn to_value(&self) -> Value[src]

Converts a Post into a template-renderable Value, representing a full post (as opposed to Post::summarize which represents a post summary). The resulting Value has fields:

  • url: The url of the post
  • title: The title of the post
  • date: The published date of the post
  • body: The post body
  • tags: A list of tags associated with the post

pub fn summarize(&self) -> Value[src]

Converts a Post into a template-renderable Value representing a post summary. The resulting Value has fields:

  • url: The url of the post
  • title: The title of the post
  • date: The published date of the post
  • summary: The post summary if there is a <!-- more --> tag or else the full post body
  • summarized: A boolean value representing whether or not a <!-- more --> tag was found and thus the post was truncated.
  • tags: A list of tags associated with the post

Trait Implementations

impl Clone for Post[src]

impl<'de> Deserialize<'de> for Post[src]

Auto Trait Implementations

impl RefUnwindSafe for Post

impl Send for Post

impl Sync for Post

impl Unpin for Post

impl UnwindSafe for Post

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.