jekyll_asset_pipeline 0.7.0 → 0.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34f1235420f955670222b56e026baa37efe0c7f6525048918616a78aa102c400
4
- data.tar.gz: 8a2e180e4db7c48d11baeaa8d5b9a6111f22892ac02c3b34f184f6ee4e903a1d
3
+ metadata.gz: cdb36c51bcc68063b82be6f7ea5c45bc1bf8d597eef5099fe481d35ee9b38c1d
4
+ data.tar.gz: 49287e795eb846822b22eedb996a910c29e561719f7ced2ebb9ce597c38cfe5c
5
5
  SHA512:
6
- metadata.gz: 95472dfc679a1e5bb7f557f2cb1f24c98211900f7e1a3e714d71abe4e29236a97f7fddba00f620ffcd37df9b64401aeb5bcf3995f9213624e58ba958c7a05042
7
- data.tar.gz: 7c2fddcecf364532a04fb2f8988478cc2be94d0c6c05f0e7abde2744ff01f2ac26abb1616b72eec26431d55d284fd94687f783b0020c0f90a254cc8c8a291d88
6
+ metadata.gz: c061345c7645f334288dc12b230084b522c0495ef21db06092988aa60d99d0bd5419f61aacb7a4e632e9ce39613b97380b1cf31fd74806f1f13ceaea8a921e6a
7
+ data.tar.gz: d81ed8dbd955d6dad46652017b01d7e6d8209cc209b7448967f7fad00a6be94706167f651d155b6021dd5269080e8017f4e3dc001db23e497c4e56ff9e7c3fe5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1 (2026-06-01)
4
+
5
+ **Bug fixes**
6
+
7
+ * Fixed an infinite Jekyll `--watch` rebuild loop. `staging_path` now
8
+ defaults to a per-process temp directory (`/tmp/jekyll_asset_pipeline_<pid>`)
9
+ outside the source tree, so staged assets no longer trip the file watcher.
10
+ Relative `staging_path` values are still resolved against the Jekyll source. [#13]
11
+ * Fixed `display_path` dropping `output_path` and prepending a spurious leading
12
+ `/`. `display_path` is now joined with `output_path` instead of replacing it,
13
+ and root-level paths no longer get a stray slash. [#12]
14
+
15
+ **Housekeeping**
16
+
17
+ * Removed CoffeeScript and YUI Compressor from the gemspec; updated stale
18
+ `matthodan` repository URLs in lib comments. [#14]
19
+
3
20
  ## 0.7.0 (2026-05-17)
4
21
 
5
22
  Project adopted and moved to https://github.com/janosrusiczki/jekyll-asset-pipeline.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module JekyllAssetPipeline
4
4
  # Base class for asset compressors
5
- # See https://github.com/matthodan/jekyll-asset-pipeline#asset-compression
5
+ # See https://github.com/janosrusiczki/jekyll-asset-pipeline#asset-compression
6
6
  class Compressor
7
7
  extend JekyllAssetPipeline::SubclassTracking
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module JekyllAssetPipeline
4
4
  # Base class for asset converters
5
- # See https://github.com/matthodan/jekyll-asset-pipeline#asset-preprocessing
5
+ # See https://github.com/janosrusiczki/jekyll-asset-pipeline#asset-preprocessing
6
6
  class Converter
7
7
  extend JekyllAssetPipeline::SubclassTracking
8
8
 
@@ -43,8 +43,8 @@ module JekyllAssetPipeline
43
43
  def preserve_assets(site, config, pipeline)
44
44
  pipeline.assets.each do |asset|
45
45
  config = JekyllAssetPipeline::DEFAULTS.merge(config)
46
- staging_path = File.expand_path(File.join(site.source,
47
- config['staging_path']))
46
+ staging_path = JekyllAssetPipeline::Pipeline
47
+ .resolve_staging_path(site.source, config['staging_path'])
48
48
  site.static_files << Jekyll::StaticFile.new(site, staging_path,
49
49
  asset.output_path,
50
50
  asset.filename)
@@ -58,8 +58,13 @@ module JekyllAssetPipeline
58
58
  # Remove staged assets
59
59
  def remove_staged_assets(source, config)
60
60
  config = DEFAULTS.merge(config)
61
- staging_path = File.join(source, config['staging_path'])
62
- FileUtils.rm_rf(staging_path)
61
+ FileUtils.rm_rf(resolve_staging_path(source, config['staging_path']))
62
+ end
63
+
64
+ # Resolve staging path: absolute paths used as-is, relative paths
65
+ # joined with the Jekyll source directory.
66
+ def resolve_staging_path(source, path)
67
+ Pathname.new(path).absolute? ? path : File.join(source, path)
63
68
  end
64
69
 
65
70
  def puts(message)
@@ -213,11 +218,10 @@ module JekyllAssetPipeline
213
218
  # Save assets to file
214
219
  def save
215
220
  output_path = @options['output_path']
216
- staging_path = @options['staging_path']
221
+ base = ::JekyllAssetPipeline::Pipeline.resolve_staging_path(@source, @options['staging_path'])
217
222
 
218
223
  @assets.each do |asset|
219
- directory = File.join(@source, staging_path, output_path)
220
- write_asset_file(directory, asset)
224
+ write_asset_file(File.join(base, output_path), asset)
221
225
 
222
226
  # Store output path of saved file
223
227
  asset.output_path = output_path
@@ -240,12 +244,18 @@ module JekyllAssetPipeline
240
244
 
241
245
  # Generate html markup pointing to assets
242
246
  def markup
243
- # Use display_path if defined, otherwise use output_path in url
244
- display_path = @options['display_path'] || @options['output_path']
247
+ output_path = @options['output_path']
248
+ display_path = @options['display_path']
249
+
250
+ url_path = if display_path
251
+ [display_path.chomp('/'), output_path].reject(&:empty?).join('/')
252
+ else
253
+ output_path
254
+ end
245
255
 
246
256
  @html = @assets.map do |asset|
247
257
  klass = ::JekyllAssetPipeline::Template.klass(asset.filename)
248
- html = klass.new(display_path, asset.filename).html unless klass.nil?
258
+ html = klass.new(url_path, asset.filename).html unless klass.nil?
249
259
 
250
260
  html
251
261
  end.join
@@ -2,7 +2,7 @@
2
2
 
3
3
  module JekyllAssetPipeline
4
4
  # Base class for the tag templates
5
- # See https://github.com/matthodan/jekyll-asset-pipeline#templates
5
+ # See https://github.com/janosrusiczki/jekyll-asset-pipeline#templates
6
6
  class Template
7
7
  include JekyllAssetPipeline::TemplateHelper
8
8
  extend JekyllAssetPipeline::SubclassTracking
@@ -4,7 +4,9 @@ module JekyllAssetPipeline
4
4
  # Contains helper methods used by the tag template classes
5
5
  module TemplateHelper
6
6
  def output_path
7
- root_path? ? '' : "/#{@path}"
7
+ return '' if root_path?
8
+
9
+ @path.start_with?('/') ? @path : "/#{@path}"
8
10
  end
9
11
 
10
12
  def root_path?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllAssetPipeline
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
@@ -3,7 +3,9 @@
3
3
  # Stdlib dependencies
4
4
  require 'digest/md5'
5
5
  require 'fileutils'
6
+ require 'pathname'
6
7
  require 'time'
8
+ require 'tmpdir'
7
9
  require 'yaml'
8
10
  require 'zlib'
9
11
 
@@ -40,7 +42,10 @@ module JekyllAssetPipeline
40
42
  #
41
43
  # 'output_path' Destination for bundle file (within the '_site' directory)
42
44
  # 'display_path' Optional. Override path to assets for output HTML refs
43
- # 'staging_path' Destination for staged assets (within project root directory)
45
+ # 'staging_path' Destination for staged assets. Absolute paths are used
46
+ # as-is; relative paths are resolved against the project root.
47
+ # Defaults to a per-process temp directory outside the source
48
+ # tree so Jekyll's file watcher never sees staging writes.
44
49
  # 'bundle' true = Bundle assets, false = Leave assets unbundled
45
50
  # 'compress' true = Minify assets, false = Leave assets unminified
46
51
  # 'gzip' true = Create gzip versions,
@@ -48,7 +53,7 @@ module JekyllAssetPipeline
48
53
  DEFAULTS = {
49
54
  'output_path' => 'assets',
50
55
  'display_path' => nil,
51
- 'staging_path' => '.asset_pipeline',
56
+ 'staging_path' => File.join(Dir.tmpdir, "jekyll_asset_pipeline_#{Process.pid}"),
52
57
  'bundle' => true,
53
58
  'compress' => true,
54
59
  'gzip' => false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_asset_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hodan
8
8
  - Janos Rusiczki
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-17 00:00:00.000000000 Z
11
+ date: 2026-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -73,9 +73,9 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '13.0'
75
75
  description: |2
76
- Jekyll Asset Pipeline adds asset preprocessing (CoffeeScript, Sass,
77
- Less, ERB, etc.) and asset compression / minification / gzip (Yahoo YUI
78
- Compressor, Google Closure Compiler, etc.) to Jekyll.
76
+ Jekyll Asset Pipeline adds asset preprocessing (Sass, Less, ERB, etc.)
77
+ and asset compression / minification / gzip (Terser, Closure Compiler,
78
+ etc.) to Jekyll.
79
79
  email:
80
80
  - matthew.c.hodan@gmail.com
81
81
  - janos.rusiczki@gmail.com