1

I'm fairly new to ruby and jekyll and I wanna start using jekyll to meu personal webpage. Among the files in my repo there is a'Gemfile' and 'Gemfile.lock' files. The Gemfile is used to manage dependencis and Gemfile.lock is generated through

bundle install

Is any of them required to be in the repo, or does gh-pages overrides any definitions contained in those files?

Other contained folder is '.sass-cache'. From this question I get the impression that it's used for caching issues. Once again, is it required, or gh-pages generates those files itself?

Community
  • 1
  • 1
pedrorijo91
  • 7,635
  • 9
  • 44
  • 82

2 Answers2

1

You can version your Gemfile. This can be useful for a reinstall. gemfile.lock and .sass-cache are not necessary to push to Github. They are used locally.

If your Gemfile contains something other than:

source 'https://rubygems.org'
gem 'github-pages'

That certainly means that you use plugins that are not supported by Github (see supported plugins list here). You then need to generate your site locally and push the result to your Github.

I've described a workflow here and you can also have a look at Octopress rake file that can help for such a setup (need small hacks to be used on a basic Jekyll install).

aaron-coding
  • 2,571
  • 1
  • 23
  • 31
David Jacquel
  • 51,670
  • 6
  • 121
  • 147
0

From my interpretation of the docs, github simply uses their own github-pages gem to pull in dependencies and then runs jekyll serve on your repo.

One consequence of that is that your gemfile (and thus any gems not part of github-pages) is ignored. For example, I use jekyll-less to generate my CSS but since this is not part of github-pages, making CSS changes is a multi-step process for me:

  1. Update .less files
  2. Build
  3. Copy compiled CSS out of _site
  4. Commit .css changes
  5. Push

Another consequence is that any run-time or build-time stuff you use is ignored by github, so your .sass-cache directory does not need to be added to the repo.

Max
  • 21,123
  • 5
  • 49
  • 71