From dd3aca9042bcc51634a01fff03ca595353fdc0b4 Mon Sep 17 00:00:00 2001 From: Kwangjin Lee <k.lee-5@student.tudelft.nl> Date: Fri, 23 Aug 2024 16:12:27 +0200 Subject: [PATCH] Update 3 files - /build-page.sh - /.gitlab-ci.yml - /_config.yml --- .gitlab-ci.yml | 5 ++--- _config.yml | 5 ++++- build-page.sh | 14 +++++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23b98de..42dfcf5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,13 +5,12 @@ stages: - deploy variables: - JEKYLL_ENV: production LC_ALL: C.UTF-8 build-page: stage: build variables: - JEKYLL_ENV: production + JEKYLL_ENV: ${{ CI_COMMIT_BRANCH == "publish" && "production" || "development" }} before_script: - gem install bundler - bundle install @@ -77,4 +76,4 @@ deploy-production: url: https://mude.citg.tudelft.nl/2024 rules: - if: $CI_COMMIT_BRANCH == "publish" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish" - when: always + when: always \ No newline at end of file diff --git a/_config.yml b/_config.yml index 1ad5464..fbeec90 100644 --- a/_config.yml +++ b/_config.yml @@ -97,4 +97,7 @@ compress_html: endings: all startings: [] blanklines: false - profile: false \ No newline at end of file + 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 diff --git a/build-page.sh b/build-page.sh index 6a7ce3f..a57eaac 100644 --- a/build-page.sh +++ b/build-page.sh @@ -7,7 +7,7 @@ PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::') if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then echo "Using publish deployment strategy" - # Remove the baner which identifies the book as a draft + # 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" @@ -17,7 +17,15 @@ if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then fi else echo "Using draft deployment strategy" + # Set is_draft to true for draft deployments + yq -i '.is_draft = true' _config.yml fi -echo "Publishing to page root: \"$PAGE_ROOT\"" -bundle exec jekyll build -d public -b "$PAGE_ROOT" +echo "Config file contents after modification:" +cat _config.yml + +echo "Publishing to page root: \"$PAGE_ROOT\"" +bundle exec jekyll build -d public -b "$PAGE_ROOT" --config _config.yml + +echo "Build complete. Contents of public directory:" +ls -R public \ No newline at end of file -- GitLab