gemwriter/template.lua

97 lines
1.7 KiB
Lua

local tpl = {}
tpl.vars = {
entry = {
author = "{{ entry_author }}",
content = "{{ entry_content }}",
date = "{{ entry_date }}",
summary = "{{ entry_summary }}",
tags = "{{ entry_tags }}",
title = "{{ entry_title }}",
url = "{{ entry_url }}",
},
feed = {
date = "{{ feed_date }}",
url = "{{ feed_url }}",
},
index = {
entries = "{{ entries }}",
},
log = {
author = "{{ log_author }}",
subtitle = "{{ log_subtitle }}",
title = "{{ log_title }}",
url = "{{ log_url }}",
},
}
tpl.atom_header = [[<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>{{ log_url }}</id>
<title>{{ log_title }}</title>
<subtitle>{{ log_subtitle }}</subtitle>
<updated>{{ feed_date }}</updated>
<author>
<name>{{ log_author }}</name>
</author>
<link href="{{ log_url }}" rel="alternate"/>
<link href="{{ feed_url }}" rel="self" type="application/atom+xml"/>]]
tpl.atom_entry = [[ <entry>
<id>{{ entry_url }}</id>
<title>
<![CDATA[{{ entry_title }}]] .. "]]>" .. [[
</title>
<updated>{{ entry_date }}</updated>
<author>
<name>{{ entry_author }}</name>
</author>
<link href="{{ entry_url }}" rel="alternate"/>
<summary>
<![CDATA[{{ entry_summary }}]] .. "]]>" .. [[
</summary>
<content>
<![CDATA[{{ entry_content }}]] .. "]]>" .. [[
</content>
</entry>
]]
tpl.atom_footer = [[</feed>]]
tpl.log_gmi = [[---
date: {{ entry_date }}
---
# {{ entry_title }}
# Heading 1
## Heading 2
### Heading 3
List:
*
*
*
```
Preformatted text
```
## Links
=> gemini:// link
=> gemini:// link (img)
=> https:// link (https)]]
tpl.index_gmi = [[
# {{ log_title }}
{{ entries }}
]]
return tpl