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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 782d2feab522ed7e13d5b7e5829eb2e12ed2fa2a
4
- data.tar.gz: f7c2439fb383b74a63124d74d12a45987405c4dc
3
+ metadata.gz: d43c3f9bd54d201651db82eb3fb2d6f772a3e79c
4
+ data.tar.gz: 771d73f6d579755f59a9377f8e0316fa01c2510c
5
5
  SHA512:
6
- metadata.gz: 20400ffcd9c4878b2cd83c23870d8ab5eca0020f93d6ff5d96c8d0917d1d0190b9486e700633dcd90655c2c47c4568b906e2ddb5f0774a352be91b1a1609a695
7
- data.tar.gz: e4f7118ae47a720ebb028b32cc9560864a79fe402f91332dcfc3c9b3535c5b2c8259736c68b42460e57a26735ecfd4a53f2a166bcfdcea684e57476be0c882de
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 jekyll and compass that provides an bi-directional interface between the two
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 compass to generate a layout and configuration for you. The site root is the folder where your `_config.yml`
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
- Other `compass` commands will work as per usual, however you will need to add the `-r jekyll-compass --app=jekyll`
40
- parameters to make sure `compass` can find the files from this plugin that it needs. If you forget these parameters
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
- # Compiles all your Sass/Compass into the _site folder, you may also specify --css-path on the command line
44
- compass compile -r jekyll-compass --app=jekyll
45
- compass watch -r jekyll-compass --app=jekyll
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 the YAML file.
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
@@ -19,6 +19,7 @@ module Jekyll
19
19
  config = CompassConfiguration.default_configuration
20
20
  end
21
21
  config[:config_file] = config_file
22
+
22
23
  config.to_compass
23
24
  end
24
25
  end
@@ -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
- ::Compass::Configuration::Data.new(CONFIGURATION_NAME, @data)
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
- def write_configuration_files(config_file = nil)
9
- config_file ||= targetize('_data/compass.yml')
10
- unless File.exists? File.dirname(config_file)
11
- directory File.dirname(config_file)
12
- end
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 --app=jekyll -r jekyll-compass (just compile your Sass)
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 --app=jekyll -r jekyll-compass (just watches your Sass)
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 [:project_path, :project_type].include? prop
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.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-04 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: compass