-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
site.safe isn't the right way to set "production" mode #84
Comments
@tommyblue you are right about every point. The entire reason why I'm piggybacking off of safe: true
source: <your pages repo>
destination: <the build dir>
lsi: false
pygments: true I do understand the main issue: For users that intend to run custom plugins and deploy to their own setup, we get a collision of usage between disabling/enabling However one of Jekyll Bootstrap's core design philosophies is to be 100% compatible with GitHub Pages, for superior convenience. With that in mind, plugins have to take a backseat to GitHub Pages support, quite simply because GitHub does not support any plugins. I will always be open to suggestions for solving this issue though, as long as it remains compatible with GitHub pages. P.S. The GitHub pages limitation IS a limitation. But that's what JB is built for, that's JB's goal. However not being able to control the development of Jekyll is why I created http://ruhoh.com - it's still in beta but will solve all of the problems we've run into with Jekyll, GitHub Pages, and static blogging. (supports automatic environment variable toggling, like rails, natively). EDIT: seeing as how GitHub overrides the source directory:
I might be able to do some regex or something (as permitted by Liquid -_-) to infer the GitHub change. But I'll have to do some due diligence to see that it works in all cases. |
What about some config like:
with some other possible values (heroku, private, etc) to set which kind of deploy will be used? JB themes should check this value and not site.safe, so user would be free to use custom plugins. |
wont this still have to be set manually? environment flag is used to so these things should ideally happen automagically based on environment. |
sorry im on mobile. I get what you mean now. specifying a deploy strategy |
Thanks, I'll wait for your decision :) |
I've got the same problem, but I wasn't aware of the custom plugins. desc "Generate statically the site"
task :generate do
require 'jekyll'
opt = Jekyll.configuration({})
source = opt['source']
destination = opt['destination']
site = Jekyll::Site.new(opt.merge({'safe' => 'true'}))
puts "Building site: #{source} -> #{destination}"
begin
site.process
rescue Jekyll::FatalException => e
puts
puts "ERROR: YOUR SITE COULD NOT BE BUILT:"
puts "------------------------------------"
puts e.message
exit(1)
end
puts "Successfully generated site: #{source} -> #{destination}"
end As you can see I'm changing If you can add a deployment destination, like @tommyblue suggested, and add
In order to avoid any issue to github page users you can default the deployment destination to github |
I wanted to use the jekyll-tagging plugin so I can have rss feeds for each tag. Problem was that I need Edit - my current solution is to edit manually
to this
|
I really like @tommyblue's suggestion; I have run into this issue each time I upgrade jekyll-bootstrap on my personal (non-github) account. Each time I have to modify the jekyll-bootstrap code to compensate, which mades me sad. |
I use the same solution as @ubershmekel but finally it's not the best one as it implies to modify the core files of JB ... |
According to https://help.github.com/articles/using-jekyll-with-pages/, GitHub Pages injects a "github:" metadata blob in the YAML. I'll run a few tests, but if that's true, looking for a non-empty "site.github" value might be a viable means of detecting production mode for GitHub Pages. |
See comments in issue #84 for proposed strategy.
I just committed a solution at groundh0g@8fe0db8. I still need to run some tests before I issue a pull request, but I wanted to open the floor to comments / concerns. Note that GitHub Pages is given priority. The generic Jekyll environment check may indicate a production build, but the GitHub Pages check immediately follows, overriding the generic. |
You can't build using plugins AND BASE_PATH that is not "" plusjade/jekyll-bootstrap#84 (comment)
Added note (line-item comment), based on @AleksueiR's commit, to look at tweaking how JB/setup works. |
This is officially the last issue in v0.4.0 milestone. If you have comments on this, or any of the other issues in v0.4.0, please feel free to speak up. (Preferably in the issue that concerns you.) https://github.com/plusjade/jekyll-bootstrap/issues?utf8=%E2%9C%93&q=milestone%3A%22v+0.4.0%22+ |
I'll commit this tonight and label master. Missed due date by one day. D'Oh! =) |
I got distracted by a shiny object - continuous integration with Jenkins in a Docker container. Long story, but promising stuff there. Good to take the extra time, though. On further reflection, I don't think @AleksueiR's patch will be needed in the new logic. Plugins should work just fine, and sharing should still be disabled unless "production" mode is detected. |
After a false start, this appears to be merged now. |
### What is this PR for? In recent changes download links were broken on the project website ### What type of PR is it? Hot Fix ### Todos * [x] - update Jekyll version * [x] - update documentation, with `--safe` removed * [x] - add "production" mode flag though `JEKYLL_ENV` aka plusjade/jekyll-bootstrap#84 ### How should this be tested? ``` bundle update JEKYLL_ENV=production bundle exec jekyll serve ``` ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? Yes, it was Author: Alexander Bezzubov <bzz@apache.org> Author: Damien CORNEAU <corneadoug@gmail.com> Author: Alexander <abezzubov@nflabs.com> Closes #1410 from bzz/fix-download-links and squashes the following commits: 2b04e4a [Alexander] Merge pull request #11 from corneadoug/fix/otherRenderingIssues f774bb0 [Damien CORNEAU] Add extension to pages_list links 68f4d64 [Damien CORNEAU] Backport plusjade/jekyll-bootstrap#293 09f770e [Alexander Bezzubov] Add missing dependency and update deprecated config f270a43 [Alexander Bezzubov] Update Jekyll in order to use JEKYLL_ENV 45bf884 [Alexander Bezzubov] Backport of plusjade/jekyll-bootstrap#262 for website
See comments in issue plusjade#84 for proposed strategy.
I think that using site.safe as flag for production mode isn't the right way to do it.
This only works on Github because it uses --safe when the site is generated. I think that the real purpose of --safe used by Github is a matter of security. This can be false outside it, e.g. on my own server, Heroku or wherever I'm deploying my site and if I want to use a custom plugin (disabled by --safe).
This generates big confusion when migrating from/to github or when developing a generic theme, I think you should find a better way (custom option?) to define a production mode
The text was updated successfully, but these errors were encountered: