Skip to content

Commit

Permalink
Switch asset pipeline since the old one stopped working
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingice committed Jan 7, 2013
1 parent 5724f7a commit c78fd2f
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 61 deletions.
7 changes: 3 additions & 4 deletions Gemfile
Expand Up @@ -4,9 +4,8 @@ gem 'jekyll'
gem 'haml'
gem 'rake'
gem 'rdiscount'
gem 'compass'
gem 'sass'
gem 'coffee-script'
gem 'foreman'
gem 'rb-fsevent'
gem 'capistrano'
gem 'yui-compressor'
gem 'jekyll-asset-pipeline'
gem 'yui-compressor'
18 changes: 5 additions & 13 deletions Gemfile.lock
Expand Up @@ -13,24 +13,16 @@ GEM
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
chunky_png (1.2.6)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.4.0)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
directory_watcher (1.4.1)
execjs (1.4.0)
multi_json (~> 1.0)
fast-stemmer (1.0.1)
foreman (0.60.2)
thor (>= 0.13.6)
fssm (0.2.9)
haml (3.1.7)
highline (1.6.15)
jekyll (0.11.2)
Expand All @@ -40,6 +32,9 @@ GEM
kramdown (~> 0.13)
liquid (~> 2.3)
maruku (~> 0.5)
jekyll-asset-pipeline (0.1.2)
jekyll (>= 0.10.0)
liquid (>= 1.9.0)
kramdown (0.14.0)
liquid (2.4.1)
maruku (0.6.1)
Expand All @@ -55,11 +50,9 @@ GEM
open4 (1.3.0)
posix-spawn (0.3.6)
rake (10.0.2)
rb-fsevent (0.9.2)
rdiscount (1.6.8)
sass (3.2.3)
syntax (1.0.0)
thor (0.16.0)
yui-compressor (0.9.6)
POpen4 (>= 0.1.4)

Expand All @@ -69,11 +62,10 @@ PLATFORMS
DEPENDENCIES
capistrano
coffee-script
compass
foreman
haml
jekyll
jekyll-asset-pipeline
rake
rb-fsevent
rdiscount
sass
yui-compressor
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -19,8 +19,7 @@ sudo easy_install pygments
When you're ready, in the base directory run:

```
bundle install
bundle exec foreman start
jekyll --auto --server
```

The site will be available at http://localhost:4000 and changes will automatically recompile.
File renamed without changes.
@@ -1,7 +1,3 @@
---
# this is required
---

caman = null
presetCaman = null
filters = {} # Filter values
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,3 @@
---
# Required
---

setActiveSection = ($spy) ->
id = $spy.attr('id')
$spy.attr('id', '')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions sass/main.scss → _assets/sass/main.css.scss
@@ -1,6 +1,6 @@
@import "_custom_mixins";
@import "_type";
@import "_header";
@import "_assets/sass/_custom_mixins.css.scss";
@import "_assets/sass/_type.css.scss";
@import "_assets/sass/_header.css.scss";

$siteWidth: 600px;

Expand Down Expand Up @@ -72,4 +72,7 @@ body {
cursor: pointer;
display: block;
text-align: center;
}
}

@import "_assets/sass/sections/examples.css.scss";
@import "_assets/sass/sections/home.css.scss";
File renamed without changes.
@@ -1,5 +1,3 @@
@import "../_custom_mixins";

#Filters {
margin: 10px 0;

Expand Down
@@ -1,5 +1,3 @@
@import "../_custom_mixins";

#HomeExamples {
.Left, .Right {
text-align: center;
Expand Down
12 changes: 5 additions & 7 deletions _config.yml
Expand Up @@ -4,13 +4,11 @@ server_port: 4000
url: http://localhost:4000
markdown: rdiscount
pygments: true
asset_bundler:
compress:
js: yui
css: yui
base_path: /bundles/
remove_bundled: false
dev: false
asset_pipeline:
bundle: true # Default = true
compress: true # Default = true
output_path: assets # Default = assets
gzip: false # Default = false
caman:
stable_version: 4.0.0
cdn_version: 3.3.0
Expand Down
40 changes: 21 additions & 19 deletions _layouts/main.html
Expand Up @@ -4,29 +4,31 @@
<meta charset="utf8">
<title>CamanJS - {{ page.title }}</title>

{% bundle %}
- /stylesheets/main.css
- /stylesheets/sections/{{page.section}}.css
- /stylesheets/pygments.css
{% endbundle %}
{% css_asset_tag site %}
- /_assets/sass/main.css.scss
- /_assets/sass/pygments.css.scss
{% endcss_asset_tag %}

<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro|Raleway:400,200,700' rel='stylesheet' type='text/css'>

{% bundle %}
- //raw.github.com/meltingice/CamanJS/master/dist/caman.full.js
- //ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
- /javascripts/copy-command.js
- /javascripts/ext/html5slider.js
- /javascripts/ext/underscore.js
{% endbundle %}

<script src="/javascripts/{{page.section}}.js"></script>

{% if site.dev or site.server %}
<script type="text/javascript">
Caman.DEBUG = true
</script>
{% if site.dev or site.server %}
<script type="text/javascript" src="//raw.github.com/meltingice/CamanJS/master/dist/caman.full.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<script type="text/javascript">
Caman.DEBUG = true
</script>
{% else %}
<script type="text/javascript" src="//raw.github.com/meltingice/CamanJS/master/dist/caman.full.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
{% endif %}

{% javascript_asset_tag site %}
- /_assets/javascripts/copy-command.js
- /_assets/javascripts/ext/html5slider.js
- /_assets/javascripts/ext/underscore.js
- /_assets/javascripts/examples.js.coffee
- /_assets/javascripts/guides.js.coffee
{% endjavascript_asset_tag %}
</head>
<body>
{{ content }}
Expand Down
51 changes: 51 additions & 0 deletions _plugins/jekyll_asset_pipeline.rb
@@ -0,0 +1,51 @@
require 'jekyll_asset_pipeline'

module JekyllAssetPipeline
class CoffeeScriptConverter < JekyllAssetPipeline::Converter
require 'coffee-script'

def self.filetype
'.coffee'
end

def convert
return CoffeeScript.compile(@content)
end
end

class SassConverter < JekyllAssetPipeline::Converter
require 'sass'

def self.filetype
'.scss'
end

def convert
return Sass::Engine.new(@content, syntax: :scss).render
end
end

class CssCompressor < JekyllAssetPipeline::Compressor
require 'yui/compressor'

def self.filetype
'.css'
end

def compress
return YUI::CssCompressor.new.compress(@content)
end
end

class JavaScriptCompressor < JekyllAssetPipeline::Compressor
require 'yui/compressor'

def self.filetype
'.js'
end

def compress
return YUI::JavaScriptCompressor.new(munge: true).compress(@content)
end
end
end

0 comments on commit c78fd2f

Please sign in to comment.