Jekyll comes with a built-in development server which allows you to preview how the generated site will look like in your browser, locally.
If you haven’t used Jekyll before, you’ll need to install it first. Just follow the instructions here.
Running the local server
To preview the RoboFont documentation locally, you’ll need to have a local version of the robofont_com repository. Follow steps 1 & 2 of Editing the documentation to fork the repository and make a clone in your machine.
To start the local server, open the Terminal, go to the repository’s folder, and tell Jekyll to build the site on the preview server:
cd path/to/robofont_com/ bundle exec jekyll serve
The output in Terminal will be something like this:
Configuration file: /_code/robofont_com/_config.yml Configuration file: /_code/robofont_com/_config.yml Source: /_code/robofont_com Destination: /_code/robofont_com/_site Incremental build: enabled Generating... done in 6.02 seconds. Auto-regeneration: enabled for '/_code/robofont_com' Configuration file: /_code/robofont_com/_config.yml Server address: http://127.0.0.1:4000/robofont_com/ Server running... press ctrl-c to stop.
Your website can now be viewed in your favorite browser in this URL:
To stop the local server, press Ctrl + c.
Editing and previewing workflow
- In your browser, go to the documentation page you would like to edit.
- Open the markdown source for that page in your code editor.
- Make changes to the source file, and save it.
- Wait a few seconds, go to your browser and reload the page.
- View changes in the updated site, think about more improvements.
- Go back to 3 and repeat.
bundle exec jekyll serve --incrementalduring development to rebuild only the modified files. This makes the editing & previewing workflow faster.