I'm new to Jekyll and would like to pull in some of the Twitter Bootstrap functionality. Has anyone done this and, if so, do you have any advice? I would have gone with Jekyll-Bootstrap, but there is no longer support for it. I have built my Jekyll site and am hoping there's a way to pull in Bootstrap.
相关问题
- How to add a “active” class to a carousel first el
- Full Clickable Accordion in Bootstrap
- Jekyll Error “Liquid Exception: undefined method `
- How to add Bootstrap 4 without Tether?
- Laravel overriding bootstrap template
相关文章
- Make Bootstrap tab Active on the bases of URL link
- “no implicit conversion of Integer into String” er
- Rails: Twitter Bootstrap Buttons when visited get
- Check if variable is type of string or array in li
- Reduce spacing between rows
- How do use bootstrap tooltips with React?
- Need to design 8 boxes in two rows
- Trigger a Bootstrap .collapse('toggle') vi
As Jekyll natively supports sass, you can use bootstrap-sass.
I personally install it with the
bower install bootstrap-sass
command.This installs Bootstrap and Jquery in the
bower_components
folder.Configuration
In your _config.yml add :
Javascript
If you want to use javascript, in your _includes/footer.html add :
Use
In
css/main.scss
delete previous content and addYou can see all variables available in
bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss
You can remove you old _sass folder.
Now your css file is generated at each build.
Update for Bootstrap 4 Beta
As Bootstrap 4 Beta now runs on Sass, you could use the "official" bower package.
Here's what I did:
1. Install Bootstrap using Bower
bower install bootstrap#v4.0.0-beta --save
to install Bootstrap and its dependencies to thebower_components
folder.2. Configuration
In
_config.yml
, I changed the Sass folder and excludedbower_components
from processing:3. Sass
I changed
assets/css/main.scss
as following:(1) Note that the second import statement has to be relative to the Sass directory specified in
_config.yml
. Since I choose it to be the folder that also contains themain.scss
, the asset linking in your favourite IDE (e.g. WebStorm) won't break.(2) To overwrite Bootstrap Sass variables, I created
assets/css/_variables.scss
which has to be imported before the Bootstrap library.4. Javascript
Since I did not find a way to use the JS shipped into
bower_components
, I choosed to include the CDN versions as proposed by Bootstrap: