cynthia_websites_mini_client/contenttypes
Types
Type storing all info it parses from files and json metadatas
pub type Content {
Content(
filename: String,
title: String,
description: String,
layout: String,
permalink: String,
inner_plain: String,
data: ContentData,
)
}
Constructors
-
Content( filename: String, title: String, description: String, layout: String, permalink: String, inner_plain: String, data: ContentData, )
pub type ContentData {
PostData(
date_published: String,
date_updated: String,
category: String,
tags: List(String),
)
PageData(in_menus: List(Int), hide_meta_block: Bool)
}
Constructors
-
PostData( date_published: String, date_updated: String, category: String, tags: List(String), )Post metadata
Arguments
- date_published
-
Date string: This is decoded as a string, then recoded and decoded again to make sure it complies with ISO 8601.
Date published
Stores the date on which the post was published.
- date_updated
-
Date string: This is decoded as a string, then recoded and decoded again to make sure it complies with ISO 8601.
Date updated
Stores the date on which the post was last updated.
- category
-
Category this post belongs to
- tags
-
Tags that belong to this post
-
PageData(in_menus: List(Int), hide_meta_block: Bool)Page metadata
Arguments
- in_menus
-
In which menus this page should appear
- hide_meta_block
-
Hide the block with title and description for a page.
Values
pub fn content_data_decoder() -> decode.Decoder(ContentData)
pub fn content_decoder() -> decode.Decoder(Content)
pub fn content_decoder_and_merger(
inner_plain: String,
filename: String,
) -> decode.Decoder(Content)
pub fn encode_content_data(
content_data: ContentData,
) -> json.Json