tale/content
Types
pub type PageData {
PageData(
relative_path: String,
output_rel_path: String,
output_abs_path: String,
permalink: String,
layout: String,
metadata: PageMetadata,
body_html: String,
)
}
Constructors
-
PageData( relative_path: String, output_rel_path: String, output_abs_path: String, permalink: String, layout: String, metadata: PageMetadata, body_html: String, )
Type of what can be added in the frontmatter section in the top
of the markdown file. Frontmatter starts with --- and ends with ---
all frontmatter must be inside those.
pub type PageFrontmatter {
PageFrontmatter(
title: String,
description: String,
layout: String,
date: option.Option(String),
draft: Bool,
tags: List(String),
author: option.Option(String),
)
}
Constructors
-
PageFrontmatter( title: String, description: String, layout: String, date: option.Option(String), draft: Bool, tags: List(String), author: option.Option(String), )
pub type PageMetadata {
PageMetadata(
title: String,
description: String,
date: option.Option(String),
draft: Bool,
tags: List(String),
author: String,
slug: String,
)
}
Constructors
-
PageMetadata( title: String, description: String, date: option.Option(String), draft: Bool, tags: List(String), author: String, slug: String, )
Values
pub fn is_list_layout(page: PageData) -> Bool
pub fn is_post_page(page: PageData) -> Bool
pub fn load_pages(
root: String,
content_dir: String,
default_author: String,
) -> Result(List(PageData), String)
Load pages
pub fn permalink_from_output(output_rel: String) -> String