Covid-19 Expert Database
This environment uses Jekyll with Contentful, Airtable and Algolia. For Contentful, it uses Contentful’s Jekyll-Contentful-Data-Import plugin. See the readme on the repository page to learn how to configure data import.
For Airtable, it uses a modified version of Airtable Fetch plugin.
And for Algolia, it uses Jekyll Algolia Plugin. It’s documentation outlines how to configure the plugin and how to send only the relevant data and how to theme the search ui.
bundle install
or bundle install --path vendor/bundle
to install all the packages
export CONTENTFUL_M_SPACE_ID=abc123
export CONTENTFUL_M_ACCESS_TOKEN=abc123
export CONTENTFUL_API_URL="cdn.contentful.com"
export ALGOLIA_APPLICATION_ID=abc123
export ALGOLIA_API_KEY=abc123
export ALGOLIA_SEARCH_ONLY_API_KEY=abc123
export ALGOLIA_INDEX_NAME_QUESTIONS=covid19_dev
export ALGOLIA_INDEX_NAME_GLOSSARY=covid19_glossary_dev
export AIRTABLE_API_KEY=abc123
export AIRTABLE_APP_ID=abc123
Plugins are configured in _config.yml
and _config-glossary.yml
. Get your Contentful space id and access token using the Contentful web app. Open the space that you want to access (the top left corner lists all spaces), and navigate to the Settings > API keys. Select the API keys option and there should be an existing API key under Jekyll for Covid-19 Expert Database.
Get the AIRTABLE_API_KEY
from your account on Airtable and AIRTABLE_APP_ID
from the source base.
For Algolia, get the credentials from your dashboard. Set develop environment variables for index names as ALGOLIA_INDEX_NAME_QUESTIONS=covid19_dev
and ALGOLIA_INDEX_NAME_GLOSSARY=covid19_glossary_dev
. For production, remove the _dev
from them.
And run source ~/.bashrc
or open new terminal to enable changes.
./build.sh
to build the site by fetching content from Contentful, Airtable and sync indeces with Algolia. We are using two jekyll config files as we are sending data to two Algolia indeces and the plugin supports a single configuration at a time.jekyll serve
to serve the site at http://127.0.0.1:4000To generate pages in Jekyll based on Contentful and airtable data we are using the jekyll-datapage_gen plugin. Specify in _config.yml
the data files for which you want individual page to be generated. See plugin’s documentation and our config.yml
for the settings.
All pages are generated using the data_page_generator
plugin. See config.yml
for its configuration.
learnaboutcovid19.org is deployed on Netlify. Adding a website on Netlify is super easy. All these settings are under Build & Deploy section of Netlify’s web app. Here are the main steps:
./build.sh
See Continuous Deployment on Netlify docs to learn more.