jekyll_asset_pipeline 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +40 -130
- data/lib/jekyll_asset_pipeline/extensions/ruby/subclass_tracking.rb +1 -0
- data/lib/jekyll_asset_pipeline/pipeline.rb +19 -17
- data/lib/jekyll_asset_pipeline/version.rb +1 -1
- data/lib/jekyll_asset_pipeline.rb +0 -3
- metadata +7 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34f1235420f955670222b56e026baa37efe0c7f6525048918616a78aa102c400
|
|
4
|
+
data.tar.gz: 8a2e180e4db7c48d11baeaa8d5b9a6111f22892ac02c3b34f184f6ee4e903a1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95472dfc679a1e5bb7f557f2cb1f24c98211900f7e1a3e714d71abe4e29236a97f7fddba00f620ffcd37df9b64401aeb5bcf3995f9213624e58ba958c7a05042
|
|
7
|
+
data.tar.gz: 7c2fddcecf364532a04fb2f8988478cc2be94d0c6c05f0e7abde2744ff01f2ac26abb1616b72eec26431d55d284fd94687f783b0020c0f90a254cc8c8a291d88
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 (2026-05-17)
|
|
4
|
+
|
|
5
|
+
Project adopted and moved to https://github.com/janosrusiczki/jekyll-asset-pipeline.
|
|
6
|
+
|
|
7
|
+
**Breaking changes**
|
|
8
|
+
|
|
9
|
+
* Bundle filenames now use an MD5 hash of the compiled output content instead of
|
|
10
|
+
the pipeline parameters. On first build after upgrading, all existing bundle
|
|
11
|
+
filenames will change (one-time). Previously, the hash was derived from file
|
|
12
|
+
mtimes, which meant every CI build produced new filenames — `git checkout`
|
|
13
|
+
resets mtimes to the current time regardless of whether content changed. Now
|
|
14
|
+
the hash reflects actual content, so filenames are stable across CI builds and
|
|
15
|
+
local rebuilds alike. Non-manifest dependencies such as Sass `@use` partials
|
|
16
|
+
that affect output are also correctly reflected in the hash. [#55]
|
|
17
|
+
|
|
18
|
+
**Improvements**
|
|
19
|
+
|
|
20
|
+
* Log output is now aligned with Jekyll's column formatting (`Asset Pipeline:`
|
|
21
|
+
right-justified to column 20, matching `Generating...`, `Jekyll Feed:`, etc.)
|
|
22
|
+
* Raised minimum Ruby version to 2.7.0 (aligns with Jekyll's CI matrix)
|
|
23
|
+
* Updated CI from Travis to GitHub Actions (Ruby 2.7, 3.3, 3.4 matrix)
|
|
24
|
+
* Switched coverage reporting from Coveralls to Codecov
|
|
25
|
+
* Replaced `rake` 12 with 13 in dev dependencies
|
|
26
|
+
|
|
27
|
+
**Documentation**
|
|
28
|
+
|
|
29
|
+
* Modernized README: updated converter examples to `sass-embedded` (Dart Sass)
|
|
30
|
+
and `Open3`/`lessc` for LESS; replaced YUI Compressor example with Terser;
|
|
31
|
+
removed CoffeeScript and Octopress sections (both effectively abandoned)
|
|
32
|
+
* Fixed all dead links, HTTP → HTTPS, and stale repo references
|
|
33
|
+
|
|
3
34
|
## 0.6.2 (2019-10-16)
|
|
4
35
|
|
|
5
36
|
* Support Jekyll 4.0 [#53]
|
data/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Jekyll Asset Pipeline
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/jekyll_asset_pipeline)
|
|
4
|
-
[](https://github.com/janosrusiczki/jekyll-asset-pipeline/actions/workflows/ci.yml)
|
|
5
|
+
[](https://codecov.io/gh/janosrusiczki/jekyll-asset-pipeline)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Jekyll Asset Pipeline is a powerful asset pipeline that automatically collects, converts and compresses / minifies your site's JavaScript and CSS assets when you compile your [Jekyll](https://jekyllrb.com/) site.
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
10
10
|
|
|
@@ -12,16 +12,14 @@
|
|
|
12
12
|
- [How It Works](#how-it-works)
|
|
13
13
|
- [Getting Started](#getting-started)
|
|
14
14
|
- [Asset Preprocessing](#asset-preprocessing)
|
|
15
|
-
- [CoffeeScript](#coffeescript)
|
|
16
15
|
- [SASS / SCSS](#sass--scss)
|
|
17
16
|
- [LESS](#less)
|
|
18
17
|
- [Successive Preprocessing](#successive-preprocessing)
|
|
19
18
|
- [Asset Compression](#asset-compression)
|
|
20
|
-
- [
|
|
19
|
+
- [Terser](#terser)
|
|
21
20
|
- [Google's Closure Compiler](#googles-closure-compiler)
|
|
22
21
|
- [Templates](#templates)
|
|
23
22
|
- [Configuration](#configuration)
|
|
24
|
-
- [Octopress](#octopress)
|
|
25
23
|
- [Contribute](#contribute)
|
|
26
24
|
- [Community](#community)
|
|
27
25
|
- [Credits](#credits)
|
|
@@ -30,8 +28,8 @@
|
|
|
30
28
|
## Features
|
|
31
29
|
|
|
32
30
|
- Declarative dependency management via asset manifests
|
|
33
|
-
- Asset preprocessing/conversion (supports [
|
|
34
|
-
- Asset compression (supports [
|
|
31
|
+
- Asset preprocessing/conversion (supports [Sass / Scss](https://sass-lang.com/), [Less](https://lesscss.org/), Erb, etc.)
|
|
32
|
+
- Asset compression (supports [Terser](https://rubygems.org/gems/terser), [Closure Compiler](https://developers.google.com/closure/compiler/), etc.)
|
|
35
33
|
- Fingerprints bundled asset filenames with MD5 hashes for better browser caching
|
|
36
34
|
- Automatic generation of HTML `link` and `script` tags that point to bundled assets
|
|
37
35
|
- Integrates seamlessly into Jekyll's workflow, including auto site regeneration
|
|
@@ -49,13 +47,13 @@ Jekyll Asset Pipeline's workflow can be summarized as follows:
|
|
|
49
47
|
|
|
50
48
|
Jekyll Asset Pipeline is extremely easy to add to your Jekyll project and has no incremental dependencies beyond those required by Jekyll. Once you have a basic Jekyll site up and running, follow the steps below to install and configure Jekyll Asset Pipeline.
|
|
51
49
|
|
|
52
|
-
1. Install the `jekyll_asset_pipeline` gem via [
|
|
50
|
+
1. Install the `jekyll_asset_pipeline` gem via [RubyGems](https://rubygems.org/).
|
|
53
51
|
|
|
54
52
|
``` bash
|
|
55
53
|
$ gem install jekyll_asset_pipeline
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
If you are using [Bundler](
|
|
56
|
+
If you are using [Bundler](https://bundler.io/) to manage your project's gems, you can just add `jekyll_asset_pipeline` to your Gemfile and run `bundle install`.
|
|
59
57
|
|
|
60
58
|
2. Add a `_plugins` folder to your project if you do not already have one. Within the `_plugins` folder, add a file named `jekyll_asset_pipeline.rb` with the following require statement as its contents.
|
|
61
59
|
|
|
@@ -65,7 +63,7 @@ Jekyll Asset Pipeline is extremely easy to add to your Jekyll project and has no
|
|
|
65
63
|
|
|
66
64
|
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. It is recommended to use an `_assets` folder to hold your site's assets.
|
|
67
65
|
|
|
68
|
-
4. Add the following [Liquid](
|
|
66
|
+
4. Add the following [Liquid](https://shopify.github.io/liquid/) 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. 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.
|
|
69
67
|
|
|
70
68
|
``` html
|
|
71
69
|
{% css_asset_tag global %}
|
|
@@ -78,7 +76,7 @@ Jekyll Asset Pipeline is extremely easy to add to your Jekyll project and has no
|
|
|
78
76
|
- /_assets/bar.js
|
|
79
77
|
{% endjavascript_asset_tag %}
|
|
80
78
|
```
|
|
81
|
-
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](
|
|
79
|
+
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](https://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.
|
|
82
80
|
|
|
83
81
|
5. Run the `jekyll build` command to compile your site. You should see an output that includes the following Jekyll Asset Pipeline status messages.
|
|
84
82
|
|
|
@@ -97,112 +95,57 @@ That is it! You should now have bundled assets. Look in the `_site` folder of yo
|
|
|
97
95
|
|
|
98
96
|
## Asset Preprocessing
|
|
99
97
|
|
|
100
|
-
Asset preprocessing (i.e. conversion) allows us to write our assets in languages such as [
|
|
101
|
-
|
|
102
|
-
In the following example, we will add a preprocessor that converts CoffeeScript into JavaScript.
|
|
103
|
-
|
|
104
|
-
### CoffeeScript
|
|
105
|
-
|
|
106
|
-
1. In the `jekyll_asset_pipeline.rb` file that we created in the [Getting Started](#getting-started) section, add the following code to the end of the file (i.e. after the `require` statement).
|
|
107
|
-
|
|
108
|
-
``` ruby
|
|
109
|
-
module JekyllAssetPipeline
|
|
110
|
-
class CoffeeScriptConverter < JekyllAssetPipeline::Converter
|
|
111
|
-
require 'coffee-script'
|
|
112
|
-
|
|
113
|
-
def self.filetype
|
|
114
|
-
'.coffee'
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
def convert
|
|
118
|
-
return CoffeeScript.compile(@content)
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
The above code adds a CoffeeScript converter. You can name a converter anything as long as it inherits from `JekyllAssetPipeline::Converter`. The `self.filetype` method defines the type of asset a converter will process (e.g. `.coffee` for CoffeeScript) based on the extension of the raw asset file. A `@content` instance variable that contains the raw content of our asset is made available within the converter. The converter should process this content and return the processed content (as a string) via a `convert` method.
|
|
125
|
-
|
|
126
|
-
2. If you haven't already, you should now install any dependancies that are required by your converter. In our case, we need to install the `coffee-script` gem.
|
|
127
|
-
|
|
128
|
-
``` bash
|
|
129
|
-
$ gem install coffee-script
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
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`.
|
|
133
|
-
|
|
134
|
-
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`.
|
|
135
|
-
|
|
136
|
-
4. Run the `jekyll build` command to compile your site.
|
|
137
|
-
|
|
138
|
-
That is it! Your asset pipeline has converted any CoffeeScript assets into JavaScript before adding them to a bundle.
|
|
98
|
+
Asset preprocessing (i.e. conversion) allows us to write our assets in languages such as [Sass](https://sass-lang.com/), [Less](https://lesscss.org/), Erb, or any other language. One of Jekyll Asset Pipeline's key strengths is that it works with __any__ preprocessing library that has a Ruby wrapper. Adding a preprocessor is straightforward, but requires a small amount of additional code.
|
|
139
99
|
|
|
140
100
|
### SASS / SCSS
|
|
141
101
|
|
|
142
|
-
|
|
102
|
+
Here's an example of a Sass converter using the actively-maintained [`sass-embedded`](https://rubygems.org/gems/sass-embedded) gem (the official Ruby binding for Dart Sass).
|
|
143
103
|
|
|
144
104
|
``` ruby
|
|
145
105
|
module JekyllAssetPipeline
|
|
146
106
|
class SassConverter < JekyllAssetPipeline::Converter
|
|
147
|
-
require 'sass'
|
|
107
|
+
require 'sass-embedded'
|
|
148
108
|
|
|
149
109
|
def self.filetype
|
|
150
110
|
'.scss'
|
|
151
111
|
end
|
|
152
112
|
|
|
153
113
|
def convert
|
|
154
|
-
|
|
114
|
+
Sass.compile_string(@content, syntax: :scss, load_paths: [@dirname]).css
|
|
155
115
|
end
|
|
156
116
|
end
|
|
157
117
|
end
|
|
158
118
|
```
|
|
159
119
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
If you're using `@import` statements in your SASS files, you'll probably need to specify a base load path to the SASS engine in your `convert` method.
|
|
163
|
-
You can use the `@dirname` instance variable for this, which contains the path to the current asset's directory:
|
|
164
|
-
|
|
165
|
-
``` ruby
|
|
166
|
-
...
|
|
167
|
-
def convert
|
|
168
|
-
return Sass::Engine.new(@content, syntax: :scss, load_paths: [@dirname]).render
|
|
169
|
-
end
|
|
170
|
-
...
|
|
171
|
-
```
|
|
120
|
+
Install the `sass-embedded` gem or add it to your Gemfile and run `bundle install`. The `load_paths: [@dirname]` option ensures that `@use` and `@import` rules resolve relative to the asset's directory.
|
|
172
121
|
|
|
173
122
|
### LESS
|
|
174
123
|
|
|
124
|
+
No actively-maintained pure-Ruby gem exists for LESS, but you can shell out to the [Node `lessc` binary](https://lesscss.org/) (install with `npm install -g less`) using Ruby's standard `Open3` library:
|
|
125
|
+
|
|
175
126
|
``` ruby
|
|
176
127
|
module JekyllAssetPipeline
|
|
177
128
|
class LessConverter < JekyllAssetPipeline::Converter
|
|
178
|
-
require '
|
|
129
|
+
require 'open3'
|
|
179
130
|
|
|
180
131
|
def self.filetype
|
|
181
132
|
'.less'
|
|
182
133
|
end
|
|
183
134
|
|
|
184
135
|
def convert
|
|
185
|
-
|
|
136
|
+
stdout, status = Open3.capture2("lessc --include-path=#{@dirname} -", stdin_data: @content)
|
|
137
|
+
raise "lessc failed" unless status.success?
|
|
138
|
+
stdout
|
|
186
139
|
end
|
|
187
140
|
end
|
|
188
141
|
end
|
|
189
142
|
```
|
|
190
143
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
As with the SASS convertor, you'll probably need to specify a base load path and pass that to the LESS Parser:
|
|
194
|
-
|
|
195
|
-
``` ruby
|
|
196
|
-
...
|
|
197
|
-
def convert
|
|
198
|
-
return Less::Parser.new(paths: [@dirname]).parse(@content).to_css
|
|
199
|
-
end
|
|
200
|
-
...
|
|
201
|
-
```
|
|
144
|
+
This pattern — shelling out to any compiler that reads from stdin — works for any tool that has a command-line interface, not just LESS.
|
|
202
145
|
|
|
203
146
|
### Successive Preprocessing
|
|
204
147
|
|
|
205
|
-
If you would like to run an asset through multiple preprocessors successively, you can do so by naming your assets with nested file extensions. Nest the extensions in the order (right to left) that the asset should be processed. For example, `.css.scss.erb` would first be processed by an `erb` preprocessor then by a `scss` preprocessor before being rendered. This convention is very similar to the convention used by the [Ruby on Rails asset pipeline](
|
|
148
|
+
If you would like to run an asset through multiple preprocessors successively, you can do so by naming your assets with nested file extensions. Nest the extensions in the order (right to left) that the asset should be processed. For example, `.css.scss.erb` would first be processed by an `erb` preprocessor then by a `scss` preprocessor before being rendered. This convention is very similar to the convention used by the [Ruby on Rails asset pipeline](https://guides.rubyonrails.org/asset_pipeline.html#preprocessing).
|
|
206
149
|
|
|
207
150
|
Don't forget to define preprocessors for the extensions you use in your filenames, otherwise Jekyll Asset Pipeline will not process your asset.
|
|
208
151
|
|
|
@@ -210,57 +153,45 @@ Don't forget to define preprocessors for the extensions you use in your filename
|
|
|
210
153
|
|
|
211
154
|
Asset compression allows us to decrease the size of our assets and increase the speed of our site. One of Jekyll Asset Pipeline's key strengths is that it works with __any__ compression library that has a ruby wrapper. Adding asset compression is straightforward, but requires a small amount of additional code.
|
|
212
155
|
|
|
213
|
-
In the following example, we will add a compressor
|
|
156
|
+
In the following example, we will add a JavaScript compressor using the actively-maintained [`terser`](https://rubygems.org/gems/terser) gem. For CSS compression, the `sass-embedded` converter shown above supports compressed output natively via `style: :compressed`.
|
|
214
157
|
|
|
215
|
-
###
|
|
158
|
+
### Terser
|
|
216
159
|
|
|
217
160
|
1. In the `jekyll_asset_pipeline.rb` file that we created in the [Getting Started](#getting-started) section, add the following code to the end of the file (i.e. after the `require` statement).
|
|
218
161
|
|
|
219
162
|
``` ruby
|
|
220
163
|
module JekyllAssetPipeline
|
|
221
|
-
class CssCompressor < JekyllAssetPipeline::Compressor
|
|
222
|
-
require 'yui/compressor'
|
|
223
|
-
|
|
224
|
-
def self.filetype
|
|
225
|
-
'.css'
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
def compress
|
|
229
|
-
return YUI::CssCompressor.new.compress(@content)
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
|
|
233
164
|
class JavaScriptCompressor < JekyllAssetPipeline::Compressor
|
|
234
|
-
require '
|
|
165
|
+
require 'terser'
|
|
235
166
|
|
|
236
167
|
def self.filetype
|
|
237
168
|
'.js'
|
|
238
169
|
end
|
|
239
170
|
|
|
240
171
|
def compress
|
|
241
|
-
|
|
172
|
+
Terser.new.compile(@content)
|
|
242
173
|
end
|
|
243
174
|
end
|
|
244
175
|
end
|
|
245
176
|
```
|
|
246
177
|
|
|
247
|
-
|
|
178
|
+
You can name a compressor anything as long as it inherits from `JekyllAssetPipeline::Compressor`. The `self.filetype` method defines the type of asset a compressor will process (either `'.js'` or `'.css'`). The `compress` method is where the magic happens. A `@content` instance variable that contains the raw content of our bundle is made available within the compressor. The compressor should process this content and return the processed content (as a string) via a `compress` method.
|
|
248
179
|
|
|
249
|
-
2. If you haven't already,
|
|
180
|
+
2. If you haven't already, install the `terser` gem.
|
|
250
181
|
|
|
251
182
|
``` bash
|
|
252
|
-
$ gem install
|
|
183
|
+
$ gem install terser
|
|
253
184
|
```
|
|
254
185
|
|
|
255
|
-
If you are using [Bundler](
|
|
186
|
+
If you are using [Bundler](https://bundler.io/) to manage your project's gems, you can just add `terser` to your Gemfile and run `bundle install`.
|
|
256
187
|
|
|
257
188
|
3. Run the `jekyll build` command to compile your site.
|
|
258
189
|
|
|
259
|
-
That is it! Your asset pipeline has compressed your
|
|
190
|
+
That is it! Your asset pipeline has compressed your JavaScript assets. You can verify that this is the case by looking at the contents of the bundles generated in the `_site/assets` folder of your project.
|
|
260
191
|
|
|
261
192
|
### Google's Closure Compiler
|
|
262
193
|
|
|
263
|
-
|
|
194
|
+
Here's an alternative example using the Google Closure Compiler.
|
|
264
195
|
|
|
265
196
|
``` ruby
|
|
266
197
|
class JavaScriptCompressor < JekyllAssetPipeline::Compressor
|
|
@@ -271,7 +202,7 @@ class JavaScriptCompressor < JekyllAssetPipeline::Compressor
|
|
|
271
202
|
end
|
|
272
203
|
|
|
273
204
|
def compress
|
|
274
|
-
|
|
205
|
+
Closure::Compiler.new.compile(@content)
|
|
275
206
|
end
|
|
276
207
|
end
|
|
277
208
|
```
|
|
@@ -311,7 +242,7 @@ That is it! Your asset pipeline used your template to generate an HTML `link` ta
|
|
|
311
242
|
|
|
312
243
|
## Configuration
|
|
313
244
|
|
|
314
|
-
Jekyll Asset Pipeline provides the following configuration options that can be controlled by adding them to your project's `_config.yml` file. If you don't have a `_config.yml` file, consider reading the [configuration section](https://
|
|
245
|
+
Jekyll Asset Pipeline provides the following configuration options that can be controlled by adding them to your project's `_config.yml` file. If you don't have a `_config.yml` file, consider reading the [configuration section](https://jekyllrb.com/docs/configuration/) of the Jekyll documentation.
|
|
315
246
|
|
|
316
247
|
``` yaml
|
|
317
248
|
asset_pipeline:
|
|
@@ -331,31 +262,11 @@ Setting | Default | Description
|
|
|
331
262
|
`gzip` | `false` | controls whether Jekyll Asset Pipeline saves gzipped versions of your assets alongside un-gzipped versions.
|
|
332
263
|
|
|
333
264
|
|
|
334
|
-
## Octopress
|
|
335
|
-
|
|
336
|
-
[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:
|
|
337
|
-
|
|
338
|
-
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.
|
|
339
|
-
|
|
340
|
-
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.
|
|
341
|
-
|
|
342
|
-
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`).
|
|
343
|
-
|
|
344
|
-
4. No change to this step.
|
|
345
|
-
|
|
346
|
-
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/).
|
|
347
|
-
|
|
348
|
-
If you have any difficulties using Jekyll Asset Pipeline with Octopress, please [open an issue](http://github.com/matthodan/jekyll-asset-pipeline/issues).
|
|
349
|
-
|
|
350
265
|
## Contribute
|
|
351
266
|
|
|
352
|
-
You can contribute to
|
|
353
|
-
|
|
354
|
-
- __Tests, tests, tests.__ **This project is now fully tested.**
|
|
355
|
-
- __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. **As of v0.1.0, Jekyll Asset Pipeline now supports successive preprocessing.**
|
|
356
|
-
- __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 is pretty interesting. That said, it is generally better to keep remote assets separate so that they load asynchronously.
|
|
267
|
+
You can contribute to Jekyll Asset Pipeline by submitting a pull request [via GitHub](https://github.com/janosrusiczki/jekyll-asset-pipeline).
|
|
357
268
|
|
|
358
|
-
If you have any ideas or you would like to see anything else improved please use the [issues section](https://github.com/
|
|
269
|
+
If you have any ideas or you would like to see anything else improved please use the [issues section](https://github.com/janosrusiczki/jekyll-asset-pipeline/issues).
|
|
359
270
|
|
|
360
271
|
## Changelog
|
|
361
272
|
|
|
@@ -363,14 +274,13 @@ See [the changelog](CHANGELOG.md).
|
|
|
363
274
|
|
|
364
275
|
## Community
|
|
365
276
|
|
|
366
|
-
- Here is [GitHub's list of projects that use the gem](https://github.com/
|
|
367
|
-
- Here is a currated list of [sites that use Jekyll Asset Pipeline](http://github.com/matthodan/jekyll-asset-pipeline/wiki/Sites-that-use-Jekyll-Asset-Pipeline). Feel free to add your site to the list if you want.
|
|
277
|
+
- Here is [GitHub's list of projects that use the gem](https://github.com/janosrusiczki/jekyll-asset-pipeline/network/dependents).
|
|
368
278
|
|
|
369
279
|
## Credits
|
|
370
280
|
|
|
371
281
|
* [Moshen](https://github.com/moshen/) for creating the [Jekyll Asset Bundler](https://github.com/moshen/jekyll-asset_bundler).
|
|
372
|
-
* [Mojombo](https://github.com/mojombo) for creating [Jekyll](https://github.com/
|
|
282
|
+
* [Mojombo](https://github.com/mojombo) for creating [Jekyll](https://github.com/jekyll/jekyll) in the first place.
|
|
373
283
|
|
|
374
284
|
## License
|
|
375
285
|
|
|
376
|
-
Jekyll Asset Pipeline is released under the [MIT License](
|
|
286
|
+
Jekyll Asset Pipeline is released under the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -62,9 +62,8 @@ module JekyllAssetPipeline
|
|
|
62
62
|
FileUtils.rm_rf(staging_path)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
# Add prefix to output
|
|
66
65
|
def puts(message)
|
|
67
|
-
|
|
66
|
+
Jekyll.logger.info('Asset Pipeline:', message)
|
|
68
67
|
end
|
|
69
68
|
|
|
70
69
|
private
|
|
@@ -107,11 +106,16 @@ module JekyllAssetPipeline
|
|
|
107
106
|
convert
|
|
108
107
|
bundle if @options['bundle']
|
|
109
108
|
compress if @options['compress']
|
|
109
|
+
finalize_bundle_filename if @options['bundle']
|
|
110
110
|
gzip if @options['gzip']
|
|
111
111
|
save
|
|
112
112
|
markup
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
+
def log_error(message)
|
|
116
|
+
Jekyll.logger.error('Asset Pipeline:', message)
|
|
117
|
+
end
|
|
118
|
+
|
|
115
119
|
# Collect assets based on manifest
|
|
116
120
|
def collect
|
|
117
121
|
@assets = YAML.safe_load(@manifest).map! do |path|
|
|
@@ -122,8 +126,7 @@ module JekyllAssetPipeline
|
|
|
122
126
|
end
|
|
123
127
|
end
|
|
124
128
|
rescue StandardError => e
|
|
125
|
-
|
|
126
|
-
"manifest: #{e.message}"
|
|
129
|
+
log_error "Failed to load assets from provided manifest: #{e.message}"
|
|
127
130
|
raise e
|
|
128
131
|
end
|
|
129
132
|
|
|
@@ -156,23 +159,24 @@ module JekyllAssetPipeline
|
|
|
156
159
|
asset.filename = File.basename(asset.filename, '.*')
|
|
157
160
|
|
|
158
161
|
# Add back the output extension if no extension left
|
|
159
|
-
if File.extname(asset.filename) == ''
|
|
160
|
-
asset.filename = "#{asset.filename}#{@type}"
|
|
161
|
-
end
|
|
162
|
+
asset.filename = "#{asset.filename}#{@type}" if File.extname(asset.filename) == ''
|
|
162
163
|
rescue StandardError => e
|
|
163
|
-
|
|
164
|
-
"with '#{klass}': #{e.message}"
|
|
164
|
+
log_error "Failed to convert '#{asset.filename}' with '#{klass}': #{e.message}"
|
|
165
165
|
raise e
|
|
166
166
|
end
|
|
167
167
|
|
|
168
168
|
# Bundle multiple assets into a single asset
|
|
169
169
|
def bundle
|
|
170
170
|
content = @assets.map(&:content).join("\n")
|
|
171
|
+
@assets = [::JekyllAssetPipeline::Asset.new(content, "#{@prefix}#{@type}")]
|
|
172
|
+
end
|
|
171
173
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
# Set final bundle filename from MD5 of post-compression content
|
|
175
|
+
def finalize_bundle_filename
|
|
176
|
+
@assets.each do |asset|
|
|
177
|
+
hash = Digest::MD5.hexdigest(asset.content)
|
|
178
|
+
asset.filename = "#{@prefix}-#{hash}#{@type}"
|
|
179
|
+
end
|
|
176
180
|
end
|
|
177
181
|
|
|
178
182
|
# Compress assets if compressor is defined
|
|
@@ -188,8 +192,7 @@ module JekyllAssetPipeline
|
|
|
188
192
|
begin
|
|
189
193
|
asset.content = klass.new(asset.content).compressed
|
|
190
194
|
rescue StandardError => e
|
|
191
|
-
|
|
192
|
-
"with '#{klass}': #{e.message}"
|
|
195
|
+
log_error "Failed to compress '#{asset.filename}' with '#{klass}': #{e.message}"
|
|
193
196
|
raise e
|
|
194
197
|
end
|
|
195
198
|
end
|
|
@@ -230,8 +233,7 @@ module JekyllAssetPipeline
|
|
|
230
233
|
file.write(asset.content)
|
|
231
234
|
end
|
|
232
235
|
rescue StandardError => e
|
|
233
|
-
|
|
234
|
-
"disk: #{e.message}"
|
|
236
|
+
log_error "Failed to save '#{asset.filename}' to disk: #{e.message}"
|
|
235
237
|
raise e
|
|
236
238
|
end
|
|
237
239
|
end
|
|
@@ -19,10 +19,7 @@ require 'jekyll_asset_pipeline/extensions/jekyll/site'
|
|
|
19
19
|
require 'jekyll_asset_pipeline/extensions/liquid/liquid_block_extensions'
|
|
20
20
|
require 'jekyll_asset_pipeline/extensions/liquid/asset_tag'
|
|
21
21
|
require 'jekyll_asset_pipeline/extensions/liquid/asset_tags/css_asset_tag'
|
|
22
|
-
# rubocop:disable Metrics/LineLength
|
|
23
22
|
require 'jekyll_asset_pipeline/extensions/liquid/asset_tags/javascript_asset_tag'
|
|
24
|
-
# rubocop:enable Metrics/LineLength
|
|
25
|
-
|
|
26
23
|
# Ruby extensions
|
|
27
24
|
require 'jekyll_asset_pipeline/extensions/ruby/subclass_tracking'
|
|
28
25
|
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll_asset_pipeline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Hodan
|
|
8
8
|
- Janos Rusiczki
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2026-05-17 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: jekyll
|
|
@@ -65,14 +64,14 @@ dependencies:
|
|
|
65
64
|
requirements:
|
|
66
65
|
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
67
|
+
version: '13.0'
|
|
69
68
|
type: :development
|
|
70
69
|
prerelease: false
|
|
71
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
72
71
|
requirements:
|
|
73
72
|
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
74
|
+
version: '13.0'
|
|
76
75
|
description: |2
|
|
77
76
|
Jekyll Asset Pipeline adds asset preprocessing (CoffeeScript, Sass,
|
|
78
77
|
Less, ERB, etc.) and asset compression / minification / gzip (Yahoo YUI
|
|
@@ -104,11 +103,10 @@ files:
|
|
|
104
103
|
- lib/jekyll_asset_pipeline/templates/javascript_tag_template.rb
|
|
105
104
|
- lib/jekyll_asset_pipeline/templates/template_helper.rb
|
|
106
105
|
- lib/jekyll_asset_pipeline/version.rb
|
|
107
|
-
homepage: https://github.com/
|
|
106
|
+
homepage: https://github.com/janosrusiczki/jekyll-asset-pipeline
|
|
108
107
|
licenses:
|
|
109
108
|
- MIT
|
|
110
109
|
metadata: {}
|
|
111
|
-
post_install_message:
|
|
112
110
|
rdoc_options: []
|
|
113
111
|
require_paths:
|
|
114
112
|
- lib
|
|
@@ -116,16 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
116
114
|
requirements:
|
|
117
115
|
- - ">="
|
|
118
116
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: 2.
|
|
117
|
+
version: 2.7.0
|
|
120
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
119
|
requirements:
|
|
122
120
|
- - ">="
|
|
123
121
|
- !ruby/object:Gem::Version
|
|
124
122
|
version: '0'
|
|
125
123
|
requirements: []
|
|
126
|
-
|
|
127
|
-
rubygems_version: 2.7.8
|
|
128
|
-
signing_key:
|
|
124
|
+
rubygems_version: 3.6.9
|
|
129
125
|
specification_version: 4
|
|
130
126
|
summary: A powerful asset pipeline for Jekyll that bundles, converts, and minifies
|
|
131
127
|
CSS and JavaScript assets.
|