jekyll-compass 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -12
- data/lib/jekyll/compass/compass_app_integration.rb +1 -0
- data/lib/jekyll/compass/compass_configuration.rb +20 -2
- data/lib/jekyll/compass/compass_installer.rb +20 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d43c3f9bd54d201651db82eb3fb2d6f772a3e79c
|
4
|
+
data.tar.gz: 771d73f6d579755f59a9377f8e0316fa01c2510c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ac6f9aecb7bdeab7eeee0cc6a32ab4ce15ed271af3574d41975cd3a2402f476f97f5b224fc524593b90b931219cf1c1a5aa140071fcb707075d89b8e0fc9ae
|
7
|
+
data.tar.gz: d98782e7a56dde8e2303d4c1a8f33f70b263460cebc3fe12a5fa6925e48fc076ea1dab48bbf3bb7f88a9575fa79b159060cb48f73d5709600529cb3400e32e77
|
data/README.md
CHANGED
@@ -11,8 +11,9 @@ jekyll-compass: Compass generator for Jekyll websites
|
|
11
11
|
Synopsis
|
12
12
|
--------
|
13
13
|
|
14
|
-
jekyll-compass is a plugin for both
|
15
|
-
applications, tightly integrating them and allowing each to work well when used directly.
|
14
|
+
jekyll-compass is a plugin for both Jekyll and Compass that provides a bi-directional interface between the two
|
15
|
+
applications, tightly integrating them and allowing each to work well together when either is used directly. In short,
|
16
|
+
if you use Compass as well as Jekyll, jekyll-compass makes your life easier.
|
16
17
|
|
17
18
|
Installation
|
18
19
|
------------
|
@@ -21,7 +22,7 @@ This plugin has a very simple two step install:
|
|
21
22
|
|
22
23
|
1. Install the gem:
|
23
24
|
|
24
|
-
gem install jekyll-compass
|
25
|
+
$ gem install jekyll-compass
|
25
26
|
|
26
27
|
2. Add the gem to your jekyll website's `_config.yml` file:
|
27
28
|
|
@@ -31,18 +32,24 @@ This plugin has a very simple two step install:
|
|
31
32
|
Usage
|
32
33
|
-----
|
33
34
|
|
34
|
-
You may use
|
35
|
-
lives.
|
35
|
+
You may use Compass to generate a layout and configuration for you. The site root is the folder where your `_config.yml`
|
36
|
+
lives. This step is highly recommended as it will also install some plumbing to help Compass work correctly with your
|
37
|
+
new jekyll-compass project. You can also install your favourite framework directly, just remember to add the extra
|
38
|
+
parameters so that Compass understands the target project structure.
|
36
39
|
|
37
40
|
compass create -r jekyll-compass --app=jekyll path/to/site/root
|
41
|
+
compass create -r jekyll-compass --app=jekyll -r zurb-foundation path/to/site/root
|
38
42
|
|
39
|
-
|
40
|
-
|
41
|
-
then Compass will fail with an error message as it won't understand the project layout.
|
43
|
+
If you are coming from an older version of jekyll-compass and just want to install the plumbing for Compass then use
|
44
|
+
this command:
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
compass init jekyll -r jekyll-compass --prepare [path/to/site/root]
|
47
|
+
|
48
|
+
Other `compass` commands will then work as per usual:
|
49
|
+
|
50
|
+
# Compiles all your Sass/Compass into the _site folder, or you may also specify --css-path on the command line
|
51
|
+
compass compile
|
52
|
+
compass watch
|
46
53
|
|
47
54
|
You will also note that Compass will build your Sass files whenever jekyll builds the rest of your website, ensuring
|
48
55
|
that what you publish is always up to date.
|
@@ -57,7 +64,7 @@ Configuration
|
|
57
64
|
You may add a file to your `_data` folder called `compass.yml`. This will contain overrides for the compass
|
58
65
|
configuration, similar to the `config.rb` in a regular compass project. If you generated a layout using compass above
|
59
66
|
then this file will already exist with some default settings setup for you. Any of the
|
60
|
-
[regular configuration properties][compass-props] should be supported via
|
67
|
+
[regular configuration properties][compass-props] should be supported via this YAML file.
|
61
68
|
|
62
69
|
Compass also provides a way to pass through options directly to Sass via the `sass_options` option. You can find
|
63
70
|
details of what options are available from Sass in the [Sass Reference][sass-props].
|
@@ -68,7 +75,11 @@ An example configuration file might look like the following:
|
|
68
75
|
sass_options:
|
69
76
|
unix_newlines: true
|
70
77
|
|
78
|
+
In order to use other plugins for compass, add them to the `require` key in your `compass.yml` file. There is also a
|
79
|
+
`load` and `discover` key which map to the relevant commands in Compass' regular configuration file.
|
71
80
|
|
81
|
+
require:
|
82
|
+
- zurb-foundation
|
72
83
|
|
73
84
|
[license]: https://raw.github.com/mscharley/jekyll-compass/master/LICENSE
|
74
85
|
[gh-contrib]: https://github.com/mscharley/jekyll-compass/graphs/contributors
|
@@ -25,13 +25,16 @@ module Jekyll
|
|
25
25
|
value = value.to_sym if SYMBOL_VALUES.include? key
|
26
26
|
|
27
27
|
if value.is_a? Hash
|
28
|
+
@data[key] = {} unless @data[key].is_a? Hash
|
28
29
|
value.each do |subkey, subvalue|
|
29
30
|
subkey = subkey.to_sym unless subkey.is_a? Symbol
|
31
|
+
subvalue = subvalue.to_sym if SYMBOL_VALUES.include? subkey
|
30
32
|
@data[key][subkey] = subvalue
|
31
33
|
end
|
34
|
+
else
|
35
|
+
@data[key] = value
|
32
36
|
end
|
33
37
|
|
34
|
-
@data[key] = value
|
35
38
|
end
|
36
39
|
|
37
40
|
def [](key)
|
@@ -39,7 +42,22 @@ module Jekyll
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def to_compass
|
42
|
-
|
45
|
+
required = @data.delete(:require) || []
|
46
|
+
load = @data.delete(:load) || []
|
47
|
+
discover = @data.delete(:discover) || []
|
48
|
+
|
49
|
+
config = ::Compass::Configuration::Data.new(CONFIGURATION_NAME, @data)
|
50
|
+
required.each do |name|
|
51
|
+
config.require(name)
|
52
|
+
end
|
53
|
+
load.each do |name|
|
54
|
+
config.load(name)
|
55
|
+
end
|
56
|
+
discover.each do |name|
|
57
|
+
config.discover(name)
|
58
|
+
end
|
59
|
+
|
60
|
+
config
|
43
61
|
end
|
44
62
|
|
45
63
|
private
|
@@ -5,11 +5,14 @@ module Jekyll
|
|
5
5
|
module Compass
|
6
6
|
#
|
7
7
|
class CompassInstaller < ::Compass::AppIntegration::StandAlone::Installer
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
|
9
|
+
def prepare
|
10
|
+
config_file = targetize('_data/compass.yml')
|
11
|
+
directory targetize('.compass')
|
12
|
+
write_file targetize('.compass/config.rb'), compass_config_contents
|
13
|
+
return if config_files_exist?
|
14
|
+
|
15
|
+
directory File.dirname(config_file)
|
13
16
|
write_file config_file, config_contents
|
14
17
|
end
|
15
18
|
|
@@ -36,6 +39,15 @@ module Jekyll
|
|
36
39
|
contents.to_yaml
|
37
40
|
end
|
38
41
|
|
42
|
+
def compass_config_contents
|
43
|
+
config = ::Compass.configuration
|
44
|
+
contents = ''
|
45
|
+
|
46
|
+
contents << "require 'jekyll-compass'\n"
|
47
|
+
contents << config.serialize_property(:project_type, config.project_type)
|
48
|
+
contents
|
49
|
+
end
|
50
|
+
|
39
51
|
def finalize(options = {})
|
40
52
|
if options[:create] && !manifest.welcome_message_options[:replace]
|
41
53
|
puts <<-NEXTSTEPS
|
@@ -55,10 +67,10 @@ You can configure your project by editing the _data/compass.yml configuration fi
|
|
55
67
|
You must compile your Sass stylesheets into CSS when they change.
|
56
68
|
This can be done in one of the following ways:
|
57
69
|
1. To compile on demand:
|
58
|
-
compass compile
|
70
|
+
compass compile (just compile your Sass)
|
59
71
|
jekyll build (compile your entire website, including Sass)
|
60
72
|
2. To monitor your project for changes and automatically recompile:
|
61
|
-
compass watch
|
73
|
+
compass watch (just watches your Sass)
|
62
74
|
|
63
75
|
More Resources:
|
64
76
|
* Website: http://compass-style.org/
|
@@ -77,7 +89,7 @@ More Resources:
|
|
77
89
|
$stderr.puts "WARNING: #{prop} is code and cannot be written to a file. You'll need to copy it yourself."
|
78
90
|
return
|
79
91
|
end
|
80
|
-
return if [:
|
92
|
+
return if [:project_type].include? prop
|
81
93
|
return if value.nil?
|
82
94
|
|
83
95
|
if value.is_a? Symbol
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Scharley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|