Using the following Jinja template, Fluid Topics can publish the following JSON file:
<html>
<head>
<title>{{ data.title }}</title>
<meta name="document_type" content="{{ data.document_type }}">
<meta name="ft:locale" content="{{ data.language }}">
</head>
<body>
{{ data.content|safe }}
</body>
</html>
{
"title": "This is an example",
"document_type": "Technical Notes",
"language": "en-US",
"content": "<h1>Chapter 1</h1><p>Lorem ipsum dolor</p><h2>Chapter 2</h2>...",
}
In the previous template:
<title>{{ data.title }}</title>
defines the publication title.<meta name="document_type" content="{{ data.document_type }}"
defines a custom metadata key calleddocument_type
with a value ofTechnical Notes
.<meta name="ft:locale" content="{{ data.language }}">
defines theft:locale
built-in metadata key that defines the publication locale.<body>{{ data.content|safe }}</body>
defines the content as HTML without escaping the HTML tags thanks to thesafe
filter. The publication content is automatically split into topics using the header tags.