From bb76ccc0d30086151f8a6ba151ff55f42192fe60 Mon Sep 17 00:00:00 2001
From: Kwangjin Lee <k.lee-5@student.tudelft.nl>
Date: Fri, 23 Aug 2024 16:19:20 +0200
Subject: [PATCH] Update 3 files

- /build-page.sh
- /.gitlab-ci.yml
- /_config.yml
---
 .gitlab-ci.yml | 11 ++++++-----
 _config.yml    |  4 ++--
 build-page.sh  | 19 ++++++-------------
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 42dfcf5..2b1b3b6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,17 +14,18 @@ build-page:
   before_script:
     - gem install bundler
     - bundle install
-    - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 --no-verbose -O /usr/local/bin/yq
-    - chmod +x /usr/local/bin/yq
     - chmod +x ./build-page.sh
   script:
     - |
-      if [ "$CI_COMMIT_BRANCH" == "publish" ] || [ "$CI_COMMIT_BRANCH" == "main" ]; then
-        echo "Running on branch $CI_COMMIT_BRANCH"
+      if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
+        echo "Running on publish branch"
         ./build-page.sh "/" true
+      elif [ "$CI_COMMIT_BRANCH" == "main" ]; then
+        echo "Running on main branch"
+        ./build-page.sh "/2024/draft" false
       else
         echo "Running on other branches"
-        ./build-page.sh /draft false
+        ./build-page.sh "/draft" false
       fi
   artifacts:
     paths:
diff --git a/_config.yml b/_config.yml
index fbeec90..23d90c7 100644
--- a/_config.yml
+++ b/_config.yml
@@ -99,5 +99,5 @@ compress_html:
   blanklines: false
   profile: false
 
-is_draft: true
-draft_banner: "This is the DRAFT version of the MUDE 2024 website. Content may change frequently."
\ No newline at end of file
+# is_draft: true
+# draft_banner: "This is the DRAFT version of the MUDE 2024 website. Content may change frequently."
\ No newline at end of file
diff --git a/build-page.sh b/build-page.sh
index a57eaac..c083b38 100644
--- a/build-page.sh
+++ b/build-page.sh
@@ -7,25 +7,18 @@ PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::')
 
 if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then
     echo "Using publish deployment strategy"
-    # Remove the banner which identifies the book as a draft
-    if ! command -v yq &>/dev/null; then
-        echo "yq could not be found, the draft banner cannot be removed"
-        echo "Please install yq (with APT or via https://github.com/mikefarah/yq#install) and try again"
-    else
-        cp _config.yml _config.yml.bak
-        yq -i '.is_draft = false' _config.yml
-    fi
+    CONFIG_FILE="_config.yml"
 else
     echo "Using draft deployment strategy"
-    # Set is_draft to true for draft deployments
-    yq -i '.is_draft = true' _config.yml
+    CONFIG_FILE="_config_draft.yml"
 fi
 
-echo "Config file contents after modification:"
-cat _config.yml
+echo "Using config file: $CONFIG_FILE"
+echo "Config file contents:"
+cat "$CONFIG_FILE"
 
 echo "Publishing to page root: \"$PAGE_ROOT\""
-bundle exec jekyll build -d public -b "$PAGE_ROOT" --config _config.yml
+bundle exec jekyll build -d public -b "$PAGE_ROOT" --config "$CONFIG_FILE"
 
 echo "Build complete. Contents of public directory:"
 ls -R public
\ No newline at end of file
-- 
GitLab