Book
A single book
object is injected into all template contexts regardless of
the template's Context Mode.
Template Fields - Book
Attribute | Type | Description |
---|---|---|
book | dictionary | book object |
book.title | string | title |
book.author | string | author |
book.tags | list[string] | the book's tags |
book.metadata | dictionary | metadata |
book.metadata.id | string | unique id |
book.metadata.last_opened | datetime | date last opened |
book.slugs | dictionary | slugs object |
book.slugs.title | string | title slugified |
book.slugs.author | string | author slugified |
book.slugs.metadata | datetime | slugs metadata object |
book.slugs.metadata.last_opened | datetime | date last opened slugified |
Example Data - Book
{
"title": "The Art Spirit",
"author": "Robert Henri",
"tags": ["#artist", "#being", "#inspiration"],
"metadata": {
"id": "1969AF0ECA8AE4965029A34316813924",
"last_opened": "2021-11-02T18:27:04.781938076Z"
},
"slugs": {
"title": "the-art-spirit",
"author": "robert-henri"
}
}
Example Template - Book
---
title: {{ book.title }}
author: {{ book.author }}
tags: {{ book.tags | join(sep=" ") }}
id: {{ book.metadata.id }}
last-opened: {{ book.metadata.last_opened | date(format="%Y-%m-%d-%H:%M") }}
---
Here Tera's
date
filter is used to format adatetime
object into a human-readable date.