Renamed 'notitle' to 'noappend', and added 'date = auto' variable to automatically add the date

master
Aadhavan Srinivasan 9 months ago
parent 506ea63f52
commit 8c4862cd05

@ -58,7 +58,7 @@ convert_to_array() {
}
add_date_to_array() {
if test -z "${meta_array[date]}"; then # If there is no existing date in the metadata
if [[ "${meta_array[date]}" == "auto" ]]; then # If the date is set to 'auto'
meta_array["date"]="$(date -r $1 +'%b %d, %Y')"
fi
}
@ -68,12 +68,12 @@ add_header_and_footer() {
cp $BASE_PATH/header.html $BASE_PATH/temp/temp_header.html
# Check for relevant metadata, and perform corresponding action
if [[ "${meta_array[nodate]}" == "true" ]]; then
sed -i '$ d' $BASE_PATH/temp/temp_header.html # 'nodate' removes the 'date published' section of the header
if test -z "${meta_array[date]}"; then #If there is no date
sed -i '$ d' $BASE_PATH/temp/temp_header.html # remove the 'date published' section of the header
fi
if [[ "${meta_array[notitle]}" == "true" ]]; then
sed -i 's/ - Two More Cents//g' $BASE_PATH/temp/temp_header.html # 'notitle' removes the suffix from the title
if [[ "${meta_array[noappend]}" == "true" ]]; then
sed -i 's/ - Two More Cents//g' $BASE_PATH/temp/temp_header.html # 'noappend' removes the suffix from the title
fi
# Add header

Loading…
Cancel
Save