Skip to content

Commit 68f6f40

Browse files
committed
Initial commit
1 parent 1706bed commit 68f6f40

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

Rakefile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Where our Bootstrap source is installed. Can be overridden by an environment variable.
2+
BOOTSTRAP_SOURCE = File.expand_path("../bootstrap")
3+
4+
# Where to find our custom LESS file.
5+
BOOTSTRAP_CUSTOM_LESS = '_less/custom.less'
6+
7+
def different?(path1, path2)
8+
require 'digest/md5'
9+
different = false
10+
if File.exist?(path1) && File.exist?(path2)
11+
path1_md5 = Digest::MD5.hexdigest(File.read path1)
12+
path2_md5 = Digest::MD5.hexdigest(File.read path2)
13+
(path2_md5 != path1_md5)
14+
else
15+
true
16+
end
17+
end
18+
19+
task :bootstrap => [:bootstrap_img, :bootstrap_js, :bootstrap_css]
20+
21+
task :bootstrap_img do
22+
puts "Copying IMG files"
23+
Dir.glob(File.join(BOOTSTRAP_SOURCE, 'img', '*.png')).each do |source|
24+
target = File.join('img', File.basename(source))
25+
cp source, target if different?(source, target)
26+
end
27+
end
28+
29+
task :bootstrap_js do
30+
require 'uglifier'
31+
require 'erb'
32+
33+
template = ERB.new %q{
34+
<!-- AUTOMATICALLY GENERATED. DO NOT EDIT. -->
35+
<% paths.each do |path| %>
36+
<script type="text/javascript" src="/bootstrap/js/<%= path %>"></script>
37+
<% end %>
38+
}
39+
40+
paths = []
41+
minifier = Uglifier.new
42+
Dir.glob(File.join(BOOTSTRAP_SOURCE, 'js', '*.js')).each do |source|
43+
base = File.basename(source).sub(/^(.*)\.js$/, '\1.min.js')
44+
paths << base
45+
target = File.join('_bootstrap/js', base)
46+
if different?(source, target)
47+
File.open(target, 'w') do |out|
48+
out.write minifier.compile(File.read(source))
49+
end
50+
end
51+
end
52+
53+
File.open('_includes/bootstrap.js.html', 'w') do |f|
54+
f.write template.result(binding)
55+
end
56+
end
57+
58+
task :bootstrap_css do |t|
59+
puts "Copying LESS files"
60+
Dir.glob(File.join(BOOTSTRAP_SOURCE, 'less', '*.less')).each do |source|
61+
target = File.join('_bootstrap/less', File.basename(source))
62+
cp source, target if different?(source, target)
63+
end
64+
65+
puts "Compiling #{BOOTSTRAP_CUSTOM_LESS}"
66+
sh 'lessc', '--compress', BOOTSTRAP_CUSTOM_LESS, 'css/bootstrap.min.css'
67+
end
68+
69+
task :default => :bootstrap #:jekyll
70+
71+
#task :jekyll => :bootstrap do
72+
# sh 'jekyll'
73+
#end

_config.yml

Whitespace-only changes.

_layouts/default.html

Whitespace-only changes.

_less/custom.less

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ----------------------
2+
// Stock Bootstrap stuff.
3+
// ----------------------
4+
5+
@import "bootstrap.less";
6+
7+
// -----------------------
8+
// Custom stuff goes here.
9+
// -----------------------
10+
11+
// bootstrap.less doesn't include the responsive CSS. Pull it in.
12+
@import "responsive.less";
13+
14+
// Customize the navbar color, and bump the font size up a bit.
15+
@navbarBackground: #00445c;
16+
@navbarBackgroundHighlight: #0087b8;
17+
@navbarLinkColor: @white;
18+
@navbarLinkColorHover: @grayLight;
19+
@baseFontSize: 14px;

0 commit comments

Comments
 (0)