From 5680952628f24533524a175224204e8a69980080 Mon Sep 17 00:00:00 2001 From: Nils Date: Wed, 10 Jun 2020 13:12:30 +0100 Subject: [PATCH 1/2] Add ROOT_URL to table of content --- internal/globals.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/globals.sh b/internal/globals.sh index 1c9532e..c69383d 100644 --- a/internal/globals.sh +++ b/internal/globals.sh @@ -534,7 +534,7 @@ function post_markdown { [[ "${PREFER_SHORT_POSTS}" == "yes" ]] && \ LINK="/p/${ID}.html" || \ LINK="/posts/$(get_title "${METADATA_DIR}/${ID}/headers" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" - sed "s|\( "${TMP2}" + sed "s|\( "${TMP2}" else cat "${TMP1}" > "${TMP2}" fi From 8e200a79d9572726e280226f3973f298d328313a Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 16 Jun 2020 19:48:10 +0100 Subject: [PATCH 2/2] fix root_url fully (#2) Co-authored-by: Aadi Bajpai --- internal/globals.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/globals.sh b/internal/globals.sh index c69383d..54ad789 100644 --- a/internal/globals.sh +++ b/internal/globals.sh @@ -162,8 +162,8 @@ function build_postindex { ID="$(basename $(dirname "${P}"))" TITLE="$(get_title "${P}")" [[ "${PREFER_SHORT_POSTS}" == "yes" ]] && - LINK="/p/${ID}.html" || - LINK="/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" + LINK="${ROOT_URL}/p/${ID}.html" || + LINK="${ROOT_URL}/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" AUTHOR="$(get_author "${P}")" DATE="$(get_date "${P}")" DATE_PRETTY="$(ts_to_date "${DATE_FRMT}" "${DATE}")" @@ -233,9 +233,9 @@ function build_tagindex { TITLE="$(get_title "${HEADERS}")" if [[ "${PREFER_SHORT_POSTS}" == "yes" ]] then - LINK="/p/${ID}.html" + LINK="${ROOT_URL}/p/${ID}.html" else - LINK="/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" + LINK="${ROOT_URL}/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" fi AUTHOR="$(get_author "${HEADERS}")" echo "
  • ${TITLE} by ${AUTHOR} on ${DATE_PRETTY}
  • " | tee -a "${TMP_TAG_FILE}" @@ -532,9 +532,9 @@ function post_markdown { if (( "${#OPTS[@]}" > 0 )) && [[ " ${OPTS[@]} " =~ " for-preview " ]] then [[ "${PREFER_SHORT_POSTS}" == "yes" ]] && \ - LINK="/p/${ID}.html" || \ - LINK="/posts/$(get_title "${METADATA_DIR}/${ID}/headers" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" - sed "s|\( "${TMP2}" + LINK="${ROOT_URL}/p/${ID}.html" || \ + LINK="${ROOT_URL}/posts/$(get_title "${METADATA_DIR}/${ID}/headers" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html" + sed "s|\( "${TMP2}" else cat "${TMP1}" > "${TMP2}" fi