Edgio
Edgio

Jekyll

Jekyll is a static site generator. It takes text written in your favorite markup language and uses layouts to create a static website. You can tweak the site’s look and feel, URLs, the data displayed on the page, and more.

Create your Jekyll site

If you don’t have an existing Jekyll site, you can create one by running:

Bash
1gem install bundler jekyll
2jekyll new my-jekyll-site
3cd my-jekyll-site

Add Edgio

Bash
1# First, globally install the Edgio CLI:
2npm i -g @edgio/cli # yarn global add @edgio/cli
3# Next, create a stub package.json:
4npm init
5# Then, add Edgio to your Jekyll site:
6edgio init

Update your Edgio Router

Paste the following into routes.js:

JavaScript
1import { Router } from '@edgio/core'
2
3const ONE_DAY = 60 * 60 * 24
4const FAR_FUTURE = ONE_DAY * 365 * 10
5
6export default new Router()
7 // Prevent search engine bot(s) from indexing
8 // Read more on: https://docs.edg.io/guides/cookbook#blocking-search-engine-crawlers
9 .noIndexPermalink()
10 // Create serveStatic route for each file in the folder _site with a cache-control header of 's-maxage=315360000'
11 .static('_site')

Deploying

Deploy your app to the Sites by running the following commands in your project’s root directory:

Bash
1# Create a production build of your Jekyll site
2bundle exec jekyll build
3
4# Deploy it to Sites
5edgio deploy