jekyll-postcss 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/README.md +6 -0
- data/jekyll-postcss.gemspec +1 -1
- data/lib/jekyll-postcss/version.rb +1 -1
- data/lib/jekyll/converters/postcss.rb +19 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a733de925db3bbf96ab3535777f4e73e4f24fb12232c0c70ee6d8379ff8dd6
|
4
|
+
data.tar.gz: 88225b5629853dece1241a3973304ca24dae4c85f9dd85bc114bd64765ccb6ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78c0ff9d352295e934ae7c69d392773e5333796755182f875e6a731111c0320f6636b4248b1aad6f4195cd3cda653bb03c941bc8bded2d78f728b7b0733b35b
|
7
|
+
data.tar.gz: 9dc039ca20a50b8a9ec29ba3933c11adea7ca1f9ae48247477db54e48fc2e593450ee3a35b402ac575800de7de1a49cf3efa3143163570634d9c8df2e0a3ef9e
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Jekyll PostCSS
|
2
2
|
[![Build Status](https://travis-ci.com/mhanberg/jekyll-postcss.svg?branch=master)](https://travis-ci.com/mhanberg/jekyll-postcss)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/jekyll-postcss.svg)](https://badge.fury.io/rb/jekyll-postcss)
|
3
4
|
|
4
5
|
A plugin to use PostCSS plugins like [Autoprefixer](https://github.com/postcss/autoprefixer) or [Tailwind CSS](https://github.com/tailwindcss/tailwindcss) with Jekyll.
|
5
6
|
|
@@ -39,6 +40,11 @@ module.exports {
|
|
39
40
|
|
40
41
|
All files with the `.css` extension will now be processed by PostCSS.
|
41
42
|
|
43
|
+
|
44
|
+
### Note
|
45
|
+
|
46
|
+
`jekyll-postcss` will cache your styles to avoid rebuilding when nothing has changed.
|
47
|
+
|
42
48
|
## Development
|
43
49
|
|
44
50
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/jekyll-postcss.gemspec
CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
34
34
|
ENV["JEKYLL_VERSION"] ? "~> #{ENV["JEKYLL_VERSION"]}" : ">= 2.0"
|
35
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
36
36
|
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
-
spec.add_development_dependency "rubocop-jekyll", "~> 0.
|
37
|
+
spec.add_development_dependency "rubocop-jekyll", "~> 0.5.1"
|
38
38
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "open3"
|
4
|
+
require "digest"
|
4
5
|
|
5
6
|
module Jekyll
|
6
7
|
module Converters
|
@@ -8,6 +9,13 @@ module Jekyll
|
|
8
9
|
safe true
|
9
10
|
priority :low
|
10
11
|
|
12
|
+
def initialize(config = {})
|
13
|
+
super
|
14
|
+
|
15
|
+
@raw_cache = nil
|
16
|
+
@converted_cache = nil
|
17
|
+
end
|
18
|
+
|
11
19
|
def matches(ext)
|
12
20
|
ext.casecmp(".css").zero?
|
13
21
|
end
|
@@ -19,11 +27,19 @@ module Jekyll
|
|
19
27
|
def convert(content)
|
20
28
|
raise PostCssNotFoundError unless File.file?("./node_modules/.bin/postcss")
|
21
29
|
|
22
|
-
|
30
|
+
raw_digest = Digest::MD5.hexdigest content
|
31
|
+
if @raw_cache != raw_digest
|
32
|
+
@raw_cache = raw_digest
|
33
|
+
|
34
|
+
compiled_css, status =
|
35
|
+
Open3.capture2("./node_modules/.bin/postcss", :stdin_data => content)
|
23
36
|
|
24
|
-
|
37
|
+
raise PostCssRuntimeError unless status.success?
|
25
38
|
|
26
|
-
|
39
|
+
@converted_cache = compiled_css
|
40
|
+
else
|
41
|
+
@converted_cache
|
42
|
+
end
|
27
43
|
end
|
28
44
|
end
|
29
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-postcss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchell Hanberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.5.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.5.1
|
83
83
|
description: A PostCSS plugin for Jekyll.
|
84
84
|
email:
|
85
85
|
- mitch@mitchellhanberg.com
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.7.
|
128
|
+
rubygems_version: 2.7.6
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: A PostCSS plugin for Jekyll.
|