Nabo.Post (Nabo v2.0.0) View Source

A struct that represents a post.

This struct represents a post with its metadata, excerpt and post body, returned by Nabo.Repo.

Format

Post should be in this format:

metadata (JSON, mandatory)
---
post excerpt (Markdown, optional)
---
post body (Markdown, mandatory)

For example:

{
  "title": "Hello World",
  "slug": "hello-world",
  "published_at": "2017-01-01T00:00:00Z"
}
---
Welcome to my blog!
---
### Hello there!

This is the first post in my blog.

Post excerpt is optional, so if you prefer not to have any excerpt, leave it blank or exclude it from your post.

{
  "title": "Hello World",
  "slug": "hello-world",
  "published_at": "2017-01-01T00:00:00Z"
}
---
### Hello there!

This is the first post in my blog.

Link to this section Summary

Link to this section Types

Specs

slug() :: String.t()

Specs

t() :: %Nabo.Post{
  body: String.t(),
  body_html: String.t(),
  draft?: boolean(),
  excerpt: String.t(),
  excerpt_html: String.t(),
  metadata: Map.t(),
  published_at: DateTime.t(),
  reading_time: Float.t(),
  slug: slug(),
  title: String.t()
}