This example uses the static-rails gem. To see how this is all configured, check out config/initializers/static.rb.
See it in action in local development
- Install Ruby & hugo
cd static/docs && bundle
to set up the Jekyll appcd static/blog-docs && npm install
to set up the Eleventy app- Add this line to your system's
/etc/hosts
file:127.0.0.1 blog.localhost
- In this project's root directory run
bundle && bin/rails s
- Visit any of the static sites within:
- A Jekyll site at http://localhost:3000/docs
- A Hugo site at http://blog.localhost:3000
- An Eleventy site at http://blog.localhost:3000/docs
- A Hugo site at http://localhost:3000
See how things would look in production:
- Run
bin/rake assets:precompile
- Inspect the built assets in
static/docs/_site
static/blog/public
static/blog-docs/_site
static/marketing/public
- Run
RAILS_ENV=production bin/rails s
and verify the above URLs serve the production assets without running any dev servers
This app also includes a Cypress test (via our cypress-rails gem).
Run it with:
$ ./script/test
You can check out the CI build output, too.