From cd9cb54c72966de0b6bde9f8e4e7e0f33540d739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sat, 18 May 2024 21:38:23 +0200 Subject: feat: override variables with environment variables --- rssg | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'rssg') diff --git a/rssg b/rssg index 16fdd2b..b292eb8 100755 --- a/rssg +++ b/rssg @@ -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}" -${website_title} -${website_description} -${website_link} -$(date +"%Y") ${website_title} - All rights reserved -${website_email} -${website_email} +${SSG_WEBSITE_TITLE} +${SSG_WEBSITE_DESCRIPTION} +${SSG_WEBSITE_LINK} +$(date +"%Y") ${SSG_WEBSITE_TITLE} - All rights reserved +${SSG_WEBSITE_EMAIL} +${SSG_WEBSITE_EMAIL} ${current_date} ${current_date} -${website_generator} -${website_language} +${SSG_WEBSITE_GENERATOR} +${SSG_WEBSITE_LANGUAGE} https://validator.w3.org/feed/docs/rss2.html 1800 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}" ${title} ${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}" EOF -- cgit v1.2.3