Skip to content

Commit

Permalink
Revert "fix root_url fully (#1)"
Browse files Browse the repository at this point in the history
This reverts commit 9c522cb.
  • Loading branch information
NilsIrl committed Jun 16, 2020
1 parent 9c522cb commit 32741bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/globals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ function build_postindex {
ID="$(basename $(dirname "${P}"))"
TITLE="$(get_title "${P}")"
[[ "${PREFER_SHORT_POSTS}" == "yes" ]] &&
LINK="${ROOT_URL}/p/${ID}.html" ||
LINK="${ROOT_URL}/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html"
LINK="/p/${ID}.html" ||
LINK="/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}")"
Expand Down Expand Up @@ -233,9 +233,9 @@ function build_tagindex {
TITLE="$(get_title "${HEADERS}")"
if [[ "${PREFER_SHORT_POSTS}" == "yes" ]]
then
LINK="${ROOT_URL}/p/${ID}.html"
LINK="/p/${ID}.html"
else
LINK="${ROOT_URL}/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html"
LINK="/posts/$(echo "${TITLE}" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html"
fi
AUTHOR="$(get_author "${HEADERS}")"
echo "<li><a href='${LINK}'>${TITLE}</a> by ${AUTHOR} on ${DATE_PRETTY}</li>" | tee -a "${TMP_TAG_FILE}"
Expand Down Expand Up @@ -532,8 +532,8 @@ function post_markdown {
if (( "${#OPTS[@]}" > 0 )) && [[ " ${OPTS[@]} " =~ " for-preview " ]]
then
[[ "${PREFER_SHORT_POSTS}" == "yes" ]] && \
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"
LINK="/p/${ID}.html" || \
LINK="/posts/$(get_title "${METADATA_DIR}/${ID}/headers" | title_to_post_url)${TITLE_SEPARATOR_CHAR}${ID}.html"
sed "s|\(<a href=['\"]\)\(#.*\)|\1${LINK}\2|" "${TMP1}" > "${TMP2}"
else
cat "${TMP1}" > "${TMP2}"
Expand Down

0 comments on commit 32741bc

Please sign in to comment.