make site build in two languages

This commit is contained in:
John Hess 2024-06-12 00:44:08 -05:00
parent 68c73b5fe2
commit 7f68a9d0ef
2 changed files with 15 additions and 9 deletions

View file

@ -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:

View file

@ -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"]