146 lines
2.8 KiB
Lua
146 lines
2.8 KiB
Lua
local en = {}
|
|
|
|
-- Templates
|
|
en.tpl_vars = {
|
|
post = {
|
|
author = "{{ post_author }}",
|
|
content = "{{ post_content }}",
|
|
date = "{{ post_date }}",
|
|
summary = "{{ post_summary }}",
|
|
tags = "{{ post_tags }}",
|
|
title = "{{ post_title }}",
|
|
url = "{{ post_url }}",
|
|
},
|
|
feed = {
|
|
date = "{{ feed_date }}",
|
|
url = "{{ feed_url }}",
|
|
},
|
|
index = {
|
|
posts = "{{ posts }}",
|
|
},
|
|
log = {
|
|
author = "{{ log_author }}",
|
|
subtitle = "{{ log_subtitle }}",
|
|
title = "{{ log_title }}",
|
|
log_url = "{{ log_url }}",
|
|
},
|
|
}
|
|
|
|
en.atom_header = [[<?xml version="1.0" encoding="UTF-8"?>
|
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
|
<title>{{ log_title }}</title>
|
|
<subtitle>{{ log_subtitle }}</subtitle>
|
|
<updated>{{ feed_date }}</updated>
|
|
<author>
|
|
<name>{{ log_author }}</name>
|
|
</author>
|
|
<id>{{ feed_url }}</id>
|
|
<link href="{{ log_url }}" rel="alternate"/>
|
|
<link href="{{ feed_url }}" rel="self" type="application/atom+xml"/>
|
|
]]
|
|
|
|
en.atom_entry = [[
|
|
<entry>
|
|
<id>{{ post_url }}</id>
|
|
<title>
|
|
<![CDATA[{{ post_title }}]] .. "]]>" .. [[
|
|
|
|
</title>
|
|
<updated>{{ post_date }}</updated>
|
|
<author>
|
|
<name>{{ post_author }}</name>
|
|
</author>
|
|
<link href="{{ post_url }}" rel="alternate"/>
|
|
<summary>
|
|
<![CDATA[{{ post_summary }}]] .. "]]>" .. [[
|
|
|
|
</summary>
|
|
<content>
|
|
<![CDATA[{{ post_content }}]] .. "]]>" .. [[
|
|
|
|
</content>
|
|
</entry>
|
|
]]
|
|
|
|
en.atom_footer = [[</feed>]]
|
|
|
|
en.post = [[---
|
|
date: {{ post_date }}
|
|
---
|
|
|
|
# {{ post_title }}
|
|
|
|
|
|
|
|
|
|
## Links
|
|
|
|
=> gemini:// link
|
|
=> gemini:// link (img)
|
|
=> https:// link (https)]]
|
|
|
|
en.index = [[
|
|
# {{ log_title }}
|
|
{{ posts }}
|
|
]]
|
|
|
|
en.page = [[
|
|
# {{ post_title }}
|
|
|
|
## Heading 2
|
|
### Heading 3
|
|
|
|
List:
|
|
|
|
*
|
|
*
|
|
*
|
|
|
|
```
|
|
Preformatted text
|
|
```
|
|
|
|
|
|
## Links
|
|
|
|
=> gemini:// link
|
|
=> gemini:// link (img)
|
|
=> https:// link (https)]]
|
|
|
|
-- App command options and messages output
|
|
en.opts = {
|
|
config = "config",
|
|
page = "page",
|
|
post = "post",
|
|
index = "index",
|
|
publish = "publish",
|
|
help = "help",
|
|
version = "version",
|
|
}
|
|
|
|
en.msgs = {
|
|
add_gemtext = "Created ",
|
|
help = [[ [options] [capsule] [title]
|
|
|
|
Options:
|
|
|
|
config Generate a config directory
|
|
page [capsule] [title] Add a new page with the given title
|
|
post [capsule] [title] Add a new gemlog post with the given title
|
|
index Generate an index page and feed of posts
|
|
publish Index and copy posts remotely using scp
|
|
help Show this help message
|
|
version Print version info]],
|
|
index = "Created index page and feed.",
|
|
load_config = [[Created config files. Please edit them with the correct
|
|
details before proceeding. The config files can be found at:
|
|
]],
|
|
publish = "Published capsule.",
|
|
}
|
|
|
|
en.errs = {
|
|
invalid_cap_id = "Error: unknown capsule id.",
|
|
}
|
|
|
|
return en
|