jekyll-asset-pipeline 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -8
- data/lib/jekyll_asset_pipeline.rb +1 -2
- data/lib/jekyll_asset_pipeline/version.rb +3 -0
- metadata +4 -2
data/README.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# Jekyll Asset Pipeline
|
2
2
|
|
3
|
-
Jekyll Asset Pipeline collects, converts and minifies
|
3
|
+
[Jekyll Asset Pipeline](http://www.matthodan.com/2012/11/22/jekyll-asset-pipeline.html) is a powerful asset pipeline for Jekyll. It collects, converts and minifies JavaScript and CSS assets. Here are a sample of its features:
|
4
4
|
|
5
|
+
- Declaritive dependency management
|
6
|
+
- Asset preprocessing and compression
|
7
|
+
- MD5 fingerprinting for browser caching
|
8
|
+
- Development mode (i.e. no asset compression)
|
9
|
+
- Works with Jekyll's auto site regeneration
|
10
|
+
|
11
|
+
Jekyll Asset Pipeline adds the ability to write assets in languages such as [CoffeeScript](http://coffeescript.org/), [Sass](http://sass-lang.com/), or any other language you like via [asset converter extensions](#asset-preprocessing). It also adds the ability to minify assets with Yahoo's [YUI Compressor](http://developer.yahoo.com/yui/compressor/), Google's [Closure Compilier](https://developers.google.com/closure/compiler/), or any other compression library via [asset compressor extensions](#asset-compression).
|
5
12
|
|
6
13
|
## Table of Contents
|
7
14
|
|
@@ -10,6 +17,8 @@ Jekyll Asset Pipeline collects, converts and minifies your project’s JavaScrip
|
|
10
17
|
- [Asset Preprocessing](#asset-preprocessing)
|
11
18
|
- [Templates](#templates)
|
12
19
|
- [Configuration](#configuration)
|
20
|
+
- [Contribute](#contribute)
|
21
|
+
- [Credits](#credits)
|
13
22
|
|
14
23
|
## Getting Started
|
15
24
|
|
@@ -34,15 +43,15 @@ Add a "_assets" folder to your project and copy your JavaScript and CSS assets i
|
|
34
43
|
In the HTML "head" section of your default layout (or other HTML page) of your Jekyll site, add one or both of the following [Liquid](http://liquidmarkup.org/) blocks and replace "foo" and "bar" with your asset files. These blocks will be converted into HTML "link" and "script" tags that point to the bundled asset files. The manifest must be a properly formatted YAML array and must include paths to your raw assets from the root folder of your project.
|
35
44
|
|
36
45
|
``` html
|
37
|
-
{%
|
46
|
+
{% css_asset_tag global %}
|
38
47
|
- /_assets/foo.css
|
39
48
|
- /_assets/bar.css
|
40
|
-
{% endcss_asset_tag %}
|
49
|
+
{% endcss_asset_tag %}
|
41
50
|
|
42
|
-
{%
|
51
|
+
{% javascript_asset_tag global %}
|
43
52
|
- /_assets/foo.js
|
44
53
|
- /_assets/bar.js
|
45
|
-
{% endjavascript_asset_tag %}
|
54
|
+
{% endjavascript_asset_tag %}
|
46
55
|
```
|
47
56
|
|
48
57
|
> *The above example will create two bundles, a CSS bundle named "global-md5hash.css" and a JavaScript bundle named "global-md5hash.js" that include their respective assets per the manifest.*
|
@@ -152,7 +161,7 @@ That's it! Your asset pipeline should have converted any CoffeeScript assets in
|
|
152
161
|
|
153
162
|
### SASS
|
154
163
|
|
155
|
-
You probably get the gist of how
|
164
|
+
You probably get the gist of how converters work, but I thought I'd add an example showing how to add a SASS converter as well.
|
156
165
|
|
157
166
|
``` ruby
|
158
167
|
module JekyllAssetPipeline
|
@@ -223,8 +232,9 @@ You can contribute to the Jekyll Asset Pipeline by submitting a pull request [vi
|
|
223
232
|
Key areas that I have identified for future improvement include:
|
224
233
|
|
225
234
|
- __Tests, tests, tests.__ I'm embarassed to say that I didn't write a single test while building Jekyll Asset Pipeline. This started as a hack for my blog and quickly grew into a library as I tweaked it to support my own needs.
|
226
|
-
-
|
227
|
-
-
|
235
|
+
- __CDN support.__ Jekyll Asset Pipeline should support using a CDN to host your assets.
|
236
|
+
- __Handle remote assets.__ Right now, Jekyll Asset Pipeline does not provide any way to include remote assets in bundles unless you save them locally before generating your site. Moshen's [Jekyll Asset Bundler](https://github.com/moshen/jekyll-asset_bundler) allows you to include remote assets, which I thought was pretty interesting. That said, I think it is generally better to keep remote assets separate so that they load asynchronously.
|
237
|
+
- __Documentation.__ I wrote this readme to introduce people to Jekyll Asset Pipeline, but there should be better organized docs that can be more easily maintained.
|
228
238
|
- __Successive preprocessing.__ Currently you can only preprocess a file once. It would be better if you could run an asset through multiple preprocessors before it gets compressed and bundled.
|
229
239
|
|
230
240
|
Feel free to [message me on GitHub](http://github.com/matthodan) if you want to run an idea by me.
|
@@ -237,3 +247,6 @@ Jekyll Asset Bundler *almost* covered all of my needs when I set out to find an
|
|
237
247
|
|
238
248
|
I also have to give credit to [Mojombo](https://github.com/mojombo) for creating [Jekyll](https://github.com/mojombo/jekyll) in the first place.
|
239
249
|
|
250
|
+
---
|
251
|
+
|
252
|
+
Like this project? You may want to read [my blog](http://www.matthodan.com).
|
@@ -9,6 +9,7 @@ require 'jekyll'
|
|
9
9
|
require 'liquid'
|
10
10
|
|
11
11
|
# Jekyll extensions
|
12
|
+
require 'jekyll_asset_pipeline/version'
|
12
13
|
require 'jekyll_asset_pipeline/extendable'
|
13
14
|
require 'jekyll_asset_pipeline/asset_file'
|
14
15
|
require 'jekyll_asset_pipeline/bundler'
|
@@ -23,8 +24,6 @@ require 'jekyll_asset_pipeline/css_asset_tag'
|
|
23
24
|
require 'jekyll_asset_pipeline/javascript_asset_tag'
|
24
25
|
|
25
26
|
module JekyllAssetPipeline
|
26
|
-
VERSION = '0.0.1'
|
27
|
-
|
28
27
|
# Default configuration settings for Jekyll Asset Bundler
|
29
28
|
# Strings used for keys to play nice when merging with _config.yml
|
30
29
|
DEFAULTS = {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-asset-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -59,11 +59,13 @@ files:
|
|
59
59
|
- lib/jekyll_asset_pipeline/template.rb
|
60
60
|
- lib/jekyll_asset_pipeline/templates/css_tag_template.rb
|
61
61
|
- lib/jekyll_asset_pipeline/templates/javascript_tag_template.rb
|
62
|
+
- lib/jekyll_asset_pipeline/version.rb
|
62
63
|
- lib/jekyll_asset_pipeline.rb
|
63
64
|
- LICENSE
|
64
65
|
- README.md
|
65
66
|
homepage: http://github.com/matthodan/jekyll-asset-pipeline
|
66
|
-
licenses:
|
67
|
+
licenses:
|
68
|
+
- MIT
|
67
69
|
post_install_message:
|
68
70
|
rdoc_options: []
|
69
71
|
require_paths:
|