jekyll-asset-pipeline 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
- [Asset Compression](#asset-compression)
|
12
12
|
- [Templates](#templates)
|
13
13
|
- [Configuration](#configuration)
|
14
|
+
- [Octopress](#octopress)
|
14
15
|
- [Contribute](#contribute)
|
15
16
|
- [Community](#community)
|
16
17
|
- [Code Status](#code-status)
|
@@ -55,7 +56,7 @@ Jekyll Asset Pipeline is extremely easy to add to your Jekyll project and has no
|
|
55
56
|
|
56
57
|
3. Move your assets into a Jekyll ignored folder (i.e. a folder that begins with an underscore "\_") so that Jekyll won't include these raw assets in the site output. I recommend using an "\_assets" folder to hold your site's assets.
|
57
58
|
|
58
|
-
4. Add the following [Liquid](http://liquidmarkup.org/) blocks to your site's HTML "head" section. These blocks will be converted into HTML "link" and "script" tags that point to bundled assets. Within each block is a manifest of assets to include in the bundle. Assets are included in the same order that they are listed in the manifest. Replace the "foo" and "bar" assets with your site's assets. Name the bundle by including a string after the opening tag. We've named our bundles "global" in the below example.
|
59
|
+
4. Add the following [Liquid](http://liquidmarkup.org/) blocks to your site's HTML "head" section. These blocks will be converted into HTML "link" and "script" tags that point to bundled assets. Within each block is a manifest of assets to include in the bundle. Assets are included in the same order that they are listed in the manifest. Replace the "foo" and "bar" assets with your site's assets. At this point we are just using plain old javascript and css files (hence the ".js" and ".css" extensions). See the [Asset Preprocessing](#asset-preprocessing) section to learn how to include files that must be preprocessed (e.g. CoffeeScript, Sass, Less, Erb, etc.). Name the bundle by including a string after the opening tag. We've named our bundles "global" in the below example.
|
59
60
|
|
60
61
|
``` html
|
61
62
|
{% css_asset_tag global %}
|
@@ -68,15 +69,15 @@ Jekyll Asset Pipeline is extremely easy to add to your Jekyll project and has no
|
|
68
69
|
- /_assets/bar.js
|
69
70
|
{% endjavascript_asset_tag %}
|
70
71
|
```
|
71
|
-
> *Asset manifests must be formatted as YAML arrays and include full paths to each asset from the root of the project.*
|
72
|
+
> *Asset manifests must be formatted as YAML arrays and include full paths to each asset from the root of the project. YAML [does not allow tabbed markup](http://www.yaml.org/faq.html), so you must use spaces when indenting your YAML manifest or you will get an error when you compile your site. If you are using assets that must be preprocessed, you should append the appropriate extension (e.g. '.js.coffee', '.css.less') as discussed in the [Asset Preprocessing](#asset-preprocessing) section.*
|
72
73
|
|
73
74
|
5. Run the `jekyll` command to compile your site. You should see an output that includes the following Jekyll Asset Pipeline status messages.
|
74
75
|
|
75
76
|
``` bash
|
76
77
|
Asset Pipeline: Processing 'css_asset_tag' manifest 'global'
|
77
|
-
Asset Pipeline: Saved 'global-md5hash.css' to '
|
78
|
+
Asset Pipeline: Saved 'global-md5hash.css' to 'yoursitepath/assets'
|
78
79
|
Asset Pipeline: Processing 'javascript_asset_tag' manifest 'global'
|
79
|
-
Asset Pipeline: Saved 'global-md5hash.js' to '
|
80
|
+
Asset Pipeline: Saved 'global-md5hash.js' to 'yoursitepath/assets'
|
80
81
|
```
|
81
82
|
|
82
83
|
> *If you do not see these messages, check that you have __not__ set Jekyll's "safe" option to "true" in your site's "_config.yml". If the "safe" option is set to "true", Jekyll will not run plugins.*
|
@@ -119,7 +120,9 @@ In the following example, we will add a preprocessor that converts CoffeeScript
|
|
119
120
|
|
120
121
|
> *If you are using [Bundler](http://gembundler.com/) to manage your project's gems, you can just add "coffee-script" to your Gemfile and run `bundle install`.*
|
121
122
|
|
122
|
-
3.
|
123
|
+
3. Append a ".coffee" extension to the filename of any asset that should be converted with the `CoffeeScriptConverter`. For example, "foo.js" would become "foo.js.coffee".
|
124
|
+
|
125
|
+
4. Run the `jekyll` command to compile your site.
|
123
126
|
|
124
127
|
That is it! Your asset pipeline has converted any CoffeeScript assets into JavaScript before adding them to a bundle.
|
125
128
|
|
@@ -270,6 +273,22 @@ asset_pipeline:
|
|
270
273
|
> - The "output\_path" setting defines where generated bundles should be saved within the "\_site" folder of your project.
|
271
274
|
> - The "gzip" setting controls whether Jekyll Asset Pipeline saves gzipped versions of your assets alongside un-gzipped versions.
|
272
275
|
|
276
|
+
## Octopress
|
277
|
+
|
278
|
+
[Octopress](http://octopress.org/) is a popular framework for Jekyll that can help you get a blog up and running quickly. Jekyll Asset Pipeline can be added to an Octopress site using the [Getting Started](#getting-started) steps above with the following modifications:
|
279
|
+
|
280
|
+
1. Octopress uses Bundler to manage your site's dependencies. You should add `gem "jekyll-asset-pipeline"` to your Gemfile and then run `bundle install` to install.
|
281
|
+
|
282
|
+
2. Instead of adding a "\_plugins" folder, you should put "jekyll\_asset\_pipeline.rb" in the "plugins" folder included by default in the root of your Octopress site.
|
283
|
+
|
284
|
+
3. You should still store your assets in an Jekyll ignored folder (i.e. a folder that begins with an underscore "\_"), but note that this folder should be located within the "source" folder of your Octopress site (e.g. "source/\_assets").
|
285
|
+
|
286
|
+
4. No change to this step.
|
287
|
+
|
288
|
+
5. Instead of running the `jekyll` command to compile your site, you should use Octopress' rake commands (e.g. `rake generate`) as outlined [here](http://octopress.org/docs/blogging/).
|
289
|
+
|
290
|
+
If you have any difficulties using Jekyll Asset Pipeline with Octopress, please [open an issue](http://github.com/matthodan/jekyll-asset-pipeline/issues).
|
291
|
+
|
273
292
|
## Contribute
|
274
293
|
|
275
294
|
You can contribute to the Jekyll Asset Pipeline by submitting a pull request [via GitHub](https://github.com/matthodan/jekyll-asset-pipeline). I have identified the following areas for improvement:
|
@@ -38,7 +38,7 @@ module JekyllAssetPipeline
|
|
38
38
|
|
39
39
|
# Prevent Jekyll from cleaning up saved assets
|
40
40
|
pipeline.assets.each do |asset|
|
41
|
-
puts "Asset Pipeline: Saved '#{asset.filename}' to '
|
41
|
+
puts "Asset Pipeline: Saved '#{asset.filename}' to '#{site.dest}/#{asset.output_path}'"
|
42
42
|
site.static_files << JekyllAssetPipeline::StaticAssetFile.new(site, site.dest, asset.output_path, asset.filename)
|
43
43
|
end
|
44
44
|
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|