diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2024-05-18 21:38:23 +0200 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2024-05-18 21:38:23 +0200 |
commit | cd9cb54c72966de0b6bde9f8e4e7e0f33540d739 (patch) | |
tree | fca3124925a256dfe63d29625e94d0bcc48b9329 /rssg | |
parent | c5ad7625aaaf32ba407729aa63b3d48edb5eb910 (diff) | |
download | ssg-cd9cb54c72966de0b6bde9f8e4e7e0f33540d739.tar.gz |
feat: override variables with environment variables
Diffstat (limited to 'rssg')
-rwxr-xr-x | rssg | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -6,32 +6,32 @@ set -e current_date=$(date +"%a, %d %b %Y %H:%M:%S %z") -cat <<-EOF > "${rss_out_file}" +cat <<-EOF > "${SSG_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> +<title>${SSG_WEBSITE_TITLE}</title> +<description>${SSG_WEBSITE_DESCRIPTION}</description> +<link>${SSG_WEBSITE_LINK}</link> +<copyright>$(date +"%Y") ${SSG_WEBSITE_TITLE} - All rights reserved</copyright> +<managingEditor>${SSG_WEBSITE_EMAIL}</managingEditor> +<webMaster>${SSG_WEBSITE_EMAIL}</webMaster> <lastBuildDate>${current_date}</lastBuildDate> <pubDate>${current_date}</pubDate> -<generator>${website_generator}</generator> -<language>${website_language}</language> +<generator>${SSG_WEBSITE_GENERATOR}</generator> +<language>${SSG_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 +for file in $(__list_files_date "${SSG_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}")" + link="${SSG_WEBSITE_LINK}/$(__get_final_filename "${file}")" guid="$(echo "${link}" | "${__sha256}" | cut -d ' ' -f 1)" description=$(__generate_rss_body "${file}") - cat <<-EOF >> "${rss_out_file}" + cat <<-EOF >> "${SSG_RSS_OUT_FILE}" <item> <title>${title}</title> <link>${link}</link> @@ -42,7 +42,7 @@ for file in $(__list_files_date "${rss_dir}"); do EOF done -cat <<-EOF >> "${rss_out_file}" +cat <<-EOF >> "${SSG_RSS_OUT_FILE}" </channel> </rss> EOF |