A starting point for building single page React apps on top of Jekyll, or for adding a little bit of React on top of a standard Jekyll site.
Jekyll sites are free to host with Github Pages, provide basic compilation of site content, and via the wonderful editor Prose.io Markdown files can be edited online with no need for clients to dig into the code.
As of yet I haven't dug into matching the React router to the content built by Jekyll - I think this could work quite well, but I haven't tested it yet. Feel free to fork away and give it a go. So for now, I see two ways of using this:
To install, simply download the repository (or git clone) and run npm install
(you will also need gulp installed globally). You will also need to run bundle install
to install the jekyll ruby stuff. Once that's done its thing, run gulp
to start the development watch task; this will start the development server, and watch all assets for changes. You can open the site in your browser at http://localhost:8899
. Once you're ready to push your changes to the server, run gulp build
to compile all the site assets into /_site
.
The directory setup is a little convoluted, on account of Jekyll liking all of its src files to be in the root directory, and the two step build process (gulp / jekyll).
/src
contains the src JS and Scss files, the ones that you'll want to work on./dist
contains the compiled JS./_site
contains the final, compiled site - Gulp runs first, so /src
is compiled into /dist
and then Jekyll picks up dist, along with all its other assets, and compiles the lot into /_site
.Inspired by https://robwise.github.io/blog/jekyll-and-gulp.