Website for our team, working in Digital Technology Solutions within IITB at ESDC.
- Install Ruby v2.6.8
- Install bundler, dependencies and start the project:
# Install bundler
gem install bundler
# Install dependencies
cd /path/to/project
bundle install
# Start the project (http://localhost:4000)
jekyll serve --livereload
Troubleshooting:
- If you get the following error:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/eventmachine-1.2.7-x64-mingw32/lib/rubyeventmachine.rb:2:in `require': cannot load such file -- 2.6/rubyeventmachine (LoadError)
Execute the following two commands, and try the livereload again.
gem uninstall eventmachine
gem install eventmachine --platform ruby
- Navigate to http://127.0.0.1:4000/digital-dojo/
- Create an English and French version of the page in the respective
./_pages/en
and./_pages/fr
directory. - Use Jekyll front matter to link the pages together:
# English page
---
layout: page
title: Contact us
lang: en
ref: contact # must be same for linked English/French page
permalink: /contact-us/
---
# French page
---
layout: page
title: Contactez-nous
lang: fr
ref: contact
permalink: /contactez-nous/
---
- Edit
./_data/i18n.yml
to add new English/French strings. - Use them in the templates like so:
{{ site.data.i18n.en.key_name }} # English, hard-coded
{{ site.data.i18n.fr.key_name }} # Français, hard-coded
{{ site.data.i18n[page.lang].key_name }} # Dynamic, based on page's language
Any changes merged into master are automatically published.
Theme is based on the type-theme template.