sondr3 / generator-jekyllized

A Yeoman generator for Jekyll to rapidly build sites using Gulp
MIT License
326 stars 35 forks source link

Use a temporary directory for Jekyll data to avoid modifications to src contents when injecting #127

Closed ferrarimarco closed 8 years ago

ferrarimarco commented 8 years ago

Currently the inject:head and inject:footer tasks work directly with src/_includes/head.html and with src/_layouts/default.html.

This leads to source code modifications after each build.

A solution to this issue (that I implemented in my gulp file) is:

  1. Serve assets from '.tmp/serve' instead of '.tmp'
  2. Copy src contents (minus assets) to '.tmp/jekyll-build'
  3. Run Jekyll pointing '.tmp/jekyll-build' in _config.yml
  4. Update paths for other Gulp tasks accordingly

EDIT: maybe jekyll-build should be changed to something like src-jekyll-preprocessed to further clarify.

sondr3 commented 8 years ago

Hmm, that's true and something I hadn't thought of either, but it's not something that I have a big problem with. I'll take a look at it though and see if I can figure out something better :smiley:

ferrarimarco commented 8 years ago

Please look at my updated gulp file. A solution is already in place.

Currently I use three directories in .tmp:

  1. jekyll-preprocessed-src: everything to process with Jekyll, after injections
  2. jekyll-built: jekyll results
  3. assets-built: preprocessed assets (js, CSS, images, favicon)
sondr3 commented 8 years ago

Sweet, feel free to send PRs for these if you want to. Otherwise I'll tackle then in a few weeks.

ferrarimarco commented 8 years ago

The build is already broken, so it's difficult to write integration tests.

sondr3 commented 8 years ago

Yeah, something is broken in one of the testing packages, not really sure what gives, I'll take a look.