Skip to content

Commit

Permalink
add provision to not include forecasts if they do not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Nov 27, 2024
1 parent 0f05c46 commit 1ce0e98
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions modify-quarto-yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ YML=${1:-"/site/pages/_quarto.yml"}
CFG=${2:-"/site/site-config.yml"}
ORG=${3:-"hubverse-org"}
REPO=${4:-"hub-dashboard-template"}
FORECAST=${5:-"true"}

echo " Updating site config"
yq -i '
Expand Down Expand Up @@ -51,3 +52,8 @@ yq -i '
.format.html.css = "/dev/null"
)
' "${YML}"

if [[ "${FORECAST}" == "false" ]]; then
# remove the forecasts tab
yq -i 'del(.website.navbar.left[1]);' "${YML}"
fi
5 changes: 4 additions & 1 deletion render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ORG=${1:-"hubverse-org"}
REPO=${2:-"hub-dashboard-predtimechart"}
BRANCH=${3:-"main"}
DIR=${4:-""}
FORECASTS=${5:-"true"}
if [[ $ORG == "hubverse-org" && $REPO == "hub-dashboard-predtimechart" ]]; then
DIR="demo/"
fi
Expand All @@ -17,7 +18,9 @@ cp -R /static/* /site/pages/
bash /modify-quarto-yml.sh \
/site/pages/_quarto.yml \
/site/site-config.yml \
"${ORG}" "${REPO}"
"${ORG}" \
"${REPO}" \
"${FORECASTS}"
# modify the predtimechart js to get content from the correct place
sed -i -E "s+\{ROOT\}+$ROOT+" /site/pages/resources/predtimechart.js
# render the site!
Expand Down

0 comments on commit 1ce0e98

Please sign in to comment.