Skip to content

minor typo fix in navbar insertion script (causing issue) #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions assets/scripts/insert_navbar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fi

# Directory containing HTML files
HTML_DIR=$1
# URL of the navigation bar HTML file
NAVBAR_URL=$2
# Source URL of the navigation bar HTML file
NAVBAR_SOURCE_URL=$2
# Shift off the first two arguments so we can parse the rest
shift 2

Expand All @@ -43,15 +43,15 @@ while [[ $# -gt 0 ]]; do
done

# Determine if NAVBAR_SOURCE is a URL (starts with http or https) or a file path
if [[ $NAVBAR_SOURCE == http* ]]; then
NAVBAR_HTML=$(curl -s "$NAVBAR_SOURCE")
if [[ $NAVBAR_SOURCE_URL == http* ]]; then
NAVBAR_HTML=$(curl -s "$NAVBAR_SOURCE_URL")
else
NAVBAR_HTML=$(cat "$NAVBAR_SOURCE")
NAVBAR_HTML=$(cat "$NAVBAR_SOURCE_URL")
fi

# Check if the download was successful
if [ -z "$NAVBAR_HTML" ]; then
echo "Failed to download navbar HTML from '$NAVBAR_URL'"
echo "Failed to download navbar HTML from '$NAVBAR_SOURCE_URL'"
exit 1
fi

Expand Down
Loading