aboutsummaryrefslogtreecommitdiffstats
path: root/bin/func
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-11-16 22:54:11 +0100
committerRomain Gonçalves <me@rgoncalves.se>2022-11-16 22:54:11 +0100
commitf416a38df0caf397d22a07f227f1de72856a100a (patch)
tree5161e0f2b4a8f3533743dd934b072c6c38061403 /bin/func
parent61a336b23cfba498f56595f452a3b3440af28e88 (diff)
downloadrgoncalves.se-f416a38df0caf397d22a07f227f1de72856a100a.tar.gz
feat(bin): generate + embed description in RSS articles
Diffstat (limited to 'bin/func')
-rw-r--r--bin/func10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/func b/bin/func
index 97688f5..bea9dea 100644
--- a/bin/func
+++ b/bin/func
@@ -145,6 +145,10 @@ __lowdown() {
lowdown --html-no-skiphtml --html-no-escapehtml "${1}"
}
+__generate_rss_body() {
+ lowdown -tgemini "${1}" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'
+}
+
__apply_template() {
# 1: template name or default
m4 "templates/${1:-default}"
@@ -223,14 +227,14 @@ __handle_md() {
__generate_metadata "${1}" > "${tmp_file}.metadata"
- if [ ! "$(__get_value ${1} index)" = "" ]; then
+ if [ ! "$(__get_value "${1}" index)" = "" ]; then
__generate_index "${1}" > "${tmp_file}.index"
else
[ -f "${tmp_file}.index" ] && rm "${tmp_file}.index"
fi
- __apply_template "$(__get_value ${1} template)" > "${tmp_file}"
- __install "${tmp_file}" "$(__get_out_filename ${1})"
+ __apply_template "$(__get_value "${1}" template)" > "${tmp_file}"
+ __install "${tmp_file}" "$(__get_out_filename "${1}")"
}
__handle() {
remember that computers suck.