aboutsummaryrefslogtreecommitdiffstats
path: root/bin/rssg
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-05-15 12:51:14 +0200
committerRomain Gonçalves <me@rgoncalves.se>2024-05-15 12:51:14 +0200
commit361ab306fbc8beb1732e1059ed0c093a2a03fb67 (patch)
treeda152d15c0bdd29bf8153452a00f9ddfe4123bb5 /bin/rssg
parent6fa675b60cc15350bb5cca3e29e7023b5100f86d (diff)
downloadrgoncalves.se-361ab306fbc8beb1732e1059ed0c093a2a03fb67.tar.gz
refactor: move static site generator out of the repo
Diffstat (limited to 'bin/rssg')
-rwxr-xr-xbin/rssg48
1 files changed, 0 insertions, 48 deletions
diff --git a/bin/rssg b/bin/rssg
deleted file mode 100755
index aee5735..0000000
--- a/bin/rssg
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-. bin/func
-
-set -e
-
-current_date=$(date +"%a, %d %b %Y %H:%M:%S %z")
-
-cat <<-EOF > "${rss_out_file}"
-<rss version="2.0">
-<channel>
-<title>${website_title}</title>
-<description>${website_description}</description>
-<link>${website_link}</link>
-<copyright>$(date +"%Y") ${website_title} - All rights reserved</copyright>
-<managingEditor>${website_email}</managingEditor>
-<webMaster>${website_email}</webMaster>
-<lastBuildDate>${current_date}</lastBuildDate>
-<pubDate>${current_date}</pubDate>
-<generator>${website_generator}</generator>
-<language>${website_language}</language>
-<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
-<ttl>1800</ttl>
-EOF
-
-for file in $(__list_files_date "${rss_dir}"); do
- __get_value "${file}" "draft" >/dev/null && continue
-
- title=$(__get_value_title "${file}")
- date=$(__get_value_date_publication "${file}")
- link="${website_link}/$(__get_final_filename "${file}")"
- guid="$(echo "${link}" | "${__sha256}" | cut -d ' ' -f 1)"
- description=$(__generate_rss_body "${file}")
- cat <<-EOF >> "${rss_out_file}"
- <item>
- <title>${title}</title>
- <link>${link}</link>
- <pubDate>${date}</pubDate>
- <guid>${guid}</guid>
- <description>${description}</description>
- </item>
- EOF
-done
-
-cat <<-EOF >> "${rss_out_file}"
-</channel>
-</rss>
-EOF
remember that computers suck.