From 7f68a9d0ef424d4de037c0f1efcb26bc10542dd3 Mon Sep 17 00:00:00 2001 From: John Hess Date: Wed, 12 Jun 2024 00:44:08 -0500 Subject: [PATCH] make site build in two languages --- .gitlab-ci.yml | 17 ++++++++++++++--- _config.yml | 7 +------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e673f0..998d82a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,18 +22,29 @@ pages: script: - apt-get update - apt-get install -y zip + # Build the default EN version + - sed -i "s/REPLACEME/butterbox/g" _data/deployment.yml - bundle exec jekyll build -d public - cd public - # Make a deployable zip based on this build. - - zip -r ../site.zip ./ + - zip -r ../site-en.zip ./ + - cd .. + - git restore . + # Build the ES version (in time this should be a single build with automated language switching) + - sed -i "" 's/^languages:.*/languages: ["es", "en"]/g' ../butter-box-ui/_config.yml + - sed -i "s/REPLACEME/comolamantequilla/g" _data/deployment.yml + - bundle exec jekyll build -d public + - cd public + - zip -r ../site-es.zip ./ # Now go build the site we actually want to deploy. - cd .. + - git restore . # simulate the drive being inserted - mv simulated-usb-butter usb-butter - "sed -i 's/^baseurl.*/baseurl: \"\\/butter-box-ui\"/' _config.yml" - bundle exec jekyll build -d public # Now move the zip into the public dir so it gets served. - - mv ./site.zip ./public/site.zip + - mv ./site-en.zip ./public/site-en.zip + - mv ./site-es.zip ./public/site-es.zip - pwd - ls -la . artifacts: diff --git a/_config.yml b/_config.yml index a63bef5..1a8e669 100644 --- a/_config.yml +++ b/_config.yml @@ -7,12 +7,7 @@ twitter_username: Butter App github_username: Butter App logo: "/assets/images/butter-app-logo-small.svg" # powered by jekyll-multiple-languages-plugin -# During install, one row will be removed and the placeholder will be replaced with that code. -languages: [ - 'en', - 'es', - 'zh_Hans', -] +languages: ['en', 'es'] exclude: ["public", "Gemfile", "Gemfile.lock", "node_modules", "test"]