multi-topic, publish from gh-pages branch
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 19s
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 19s
This commit is contained in:
65
build.sh
65
build.sh
@@ -2,7 +2,8 @@
|
||||
# Full build pipeline: fetch rankings → fetch deadlines → generate content → hugo build.
|
||||
#
|
||||
# Usage:
|
||||
# ./build.sh # full build
|
||||
# ./build.sh # full build (all topics)
|
||||
# ./build.sh --topic cloud-edge # process one topic only
|
||||
# ./build.sh --skip-rankings # use cached CSVs
|
||||
# ./build.sh --skip-deadlines # use cached deadlines.yaml
|
||||
# ./build.sh --dev # run hugo server instead of building
|
||||
@@ -16,6 +17,7 @@ ICORE_QUERY=""
|
||||
SKIP_RANKINGS=0
|
||||
SKIP_DEADLINES=0
|
||||
HUGO_MODE="build"
|
||||
TOPIC=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
@@ -23,6 +25,7 @@ while [[ $# -gt 0 ]]; do
|
||||
--skip-rankings) SKIP_RANKINGS=1; shift ;;
|
||||
--skip-deadlines) SKIP_DEADLINES=1; shift ;;
|
||||
--dev) HUGO_MODE="serve"; shift ;;
|
||||
--topic) TOPIC="$2"; shift 2 ;;
|
||||
*) echo "Unknown option: $1"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
@@ -30,6 +33,7 @@ done
|
||||
# Ensure uv environment is ready
|
||||
uv sync --quiet
|
||||
|
||||
# Rankings are shared across all topics — fetch once
|
||||
if [[ $SKIP_RANKINGS -eq 0 ]]; then
|
||||
echo "==> Fetching ICORE rankings …"
|
||||
uv run pa-fetch-icore --query "$ICORE_QUERY"
|
||||
@@ -38,23 +42,54 @@ if [[ $SKIP_RANKINGS -eq 0 ]]; then
|
||||
uv run pa-fetch-scimago || echo " WARNING: SCImago fetch failed (anti-bot). Using cached/inline data."
|
||||
fi
|
||||
|
||||
if [[ $SKIP_DEADLINES -eq 0 ]]; then
|
||||
# Only run if venues.yaml has at least one conference
|
||||
if uv run python -c "
|
||||
import yaml, sys
|
||||
v = yaml.safe_load(open('site/data/venues.yaml'))
|
||||
sys.exit(0 if (v or {}).get('conferences') else 1)
|
||||
" 2>/dev/null; then
|
||||
echo "==> Fetching deadlines …"
|
||||
uv run pa-fetch-deadlines
|
||||
else
|
||||
echo "==> Skipping deadlines (no conferences in site/data/venues.yaml)"
|
||||
fi
|
||||
# Discover topics: either the single --topic flag or all from topics.yaml
|
||||
if [[ -n "$TOPIC" ]]; then
|
||||
TOPICS=("$TOPIC")
|
||||
else
|
||||
mapfile -t TOPICS < <(uv run python -c "
|
||||
import yaml
|
||||
data = yaml.safe_load(open('site/data/topics.yaml')) or {}
|
||||
for t in data.get('topics', []):
|
||||
print(t['slug'])
|
||||
")
|
||||
fi
|
||||
|
||||
echo "==> Generating Hugo content …"
|
||||
uv run pa-generate
|
||||
for TOPIC_SLUG in "${TOPICS[@]}"; do
|
||||
echo ""
|
||||
echo "==> Processing topic: $TOPIC_SLUG"
|
||||
|
||||
DATA_DIR="site/data/${TOPIC_SLUG}"
|
||||
CONTENT_DIR="site/content/${TOPIC_SLUG}"
|
||||
BASE_PATH="/${TOPIC_SLUG}"
|
||||
|
||||
if [[ $SKIP_DEADLINES -eq 0 ]]; then
|
||||
# Only run if venues.yaml has at least one conference
|
||||
if uv run python -c "
|
||||
import yaml, sys
|
||||
v = yaml.safe_load(open('${DATA_DIR}/venues.yaml'))
|
||||
sys.exit(0 if (v or {}).get('conferences') else 1)
|
||||
" 2>/dev/null; then
|
||||
echo " --> Fetching deadlines …"
|
||||
uv run pa-fetch-deadlines \
|
||||
--venues "${DATA_DIR}/venues.yaml" \
|
||||
--output "${DATA_DIR}/deadlines.yaml"
|
||||
else
|
||||
echo " --> Skipping deadlines (no conferences in venues.yaml)"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " --> Generating Hugo content …"
|
||||
uv run pa-generate \
|
||||
--venues "${DATA_DIR}/venues.yaml" \
|
||||
--deadlines "${DATA_DIR}/deadlines.yaml" \
|
||||
--papers-dir "${DATA_DIR}/papers" \
|
||||
--icore "site/data/rankings/icore.csv" \
|
||||
--scimago "site/data/rankings/scimago.csv" \
|
||||
--content "${CONTENT_DIR}" \
|
||||
--base-path "${BASE_PATH}"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "==> Building Hugo site …"
|
||||
if [[ "$HUGO_MODE" == "serve" ]]; then
|
||||
hugo --source site server --buildDrafts --bind 0.0.0.0
|
||||
|
||||
Reference in New Issue
Block a user