Nabo v0.0.4 Nabo.Metadata View Source
A struct that represents post metadata.
Represents metadata that specified in the top of the post.
Format
Metadata should be in JSON, and must have title
, slug
, and date
set.
{
"title": "Nabo Post",
"slug": "First Nabo post",
"date": "2017-01-01"
}
You can have your own customized metadata and they will be accessible in extras
.
content = ~s(
{
"title": "Nabo Post",
"slug": "First Nabo post",
"date": "2017-01-01",
"tags": ["foo", "bar"]
}
)
{:ok, post} = Nabo.Post.from_string(content)
post.metadata["tags"]