octopress-ink 1.0.0.rc.41 → 1.0.0.rc.42

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: ae4c767603111477b17cc1a114faa2b21f496f5b
4
- data.tar.gz: 1270563568f44529d5ae82c59acd1678d6877f0d
3
+ metadata.gz: b6a3788546bf6c3c415f0fd6d9c981980a23f2fe
4
+ data.tar.gz: cbdfca85d3ac072d7c3d35bc5dfa09791ff5bcd1
5
5
  SHA512:
6
- metadata.gz: fa63a50bfbdfcca6225ec32528d2adae7803bc6746be374bb82f5bc8ad62ee9d5f96c290520d526a1481a5ddcfcd60cff1c1f723392978cf75300ff6adcd8d2a
7
- data.tar.gz: 6aad860f4d89d61c12de9ab41e679377b58ab93aca49b9590326009e25951c64d36dfdc56ff9f16c3b362291f0dd79db4d34c2f86de90e8bdbffd1132d7d6ee7
6
+ metadata.gz: d0f97de7fb8c243ab15a50b38514477d05de8b4f39d99e0b0cc1a3044082dfed0896bf31496e4a6149f3c444e1ee723a0b9f11aa2b2c9c188ccf7daae2a859c3
7
+ data.tar.gz: 90feb962267ede61af217ff432b7bdceb23306994c032c75e390df763eb27c1fcbc047035da8bac575b4be49682387990acd2c65606b007b613cf5f176e5920b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 RC42 - 2015-02-15
4
+ - New: Plugins can define order for stylesheet and javascript assets.
5
+
3
6
  ### 1.0.0 RC41 - 2015-02-13
4
7
  - Fix: Properly copies pages without permalinks.
5
8
  - Permalink configurations now allow directories and file extensions in config keys.
@@ -151,6 +151,24 @@ Note: Assets are copied at build time and assets will not overwrite an existing
151
151
  | stylesheets | `theme.scss` and `print.css` are combined with all plugin stylesheets into a single fingerprinted file. |
152
152
  | docs | Add documentation files for your plugin here. Users will be able to read it by running `octopress docs`. |
153
153
 
154
+ ### Ordering Javascript and Stylesheet assets
155
+
156
+ By default when scripts and stylesheets are combined, they are added based on
157
+ their order in the file system. You can manually specify order like this:
158
+
159
+ ```
160
+ order_js:
161
+ - jquery.js
162
+ - kittens.coffee
163
+
164
+ order_css:
165
+ - normalize.css
166
+ - site.sass
167
+ ```
168
+ Assets will ordered as specified. Any additional assets will be appended based on their order in the file system.
169
+
170
+ Note: It is not necessary to write full paths in these configurations. An asset at `javascripts/lib/jquery.js` will match `jquery.js` and be ordered accordingly.
171
+
154
172
 
155
173
  ### Layouts
156
174
 
@@ -48,7 +48,6 @@ module Octopress
48
48
  add_dependency
49
49
  add_plugin
50
50
  add_assets
51
- add_test_files
52
51
  end
53
52
  end
54
53
 
@@ -191,34 +190,6 @@ website: "" # Optional project website
191
190
  config.rstrip
192
191
  end
193
192
 
194
- # Creates a blank Jekyll site for testing out a new plugin
195
- #
196
- def self.add_test_files
197
- test_dir = File.join(@settings[:path], 'test')
198
-
199
- dirs = %w{_layouts _posts _expected}.map do |d|
200
- File.join(test_dir, d)
201
- end
202
-
203
- create_empty_dirs dirs
204
-
205
- index = File.join(test_dir, 'index.html')
206
- action = File.exist?(index) ? "exists".rjust(12).blue.bold : "create".rjust(12).green.bold
207
-
208
- FileUtils.touch File.join(test_dir, '_expected', 'index.html')
209
- FileUtils.touch File.join(test_dir, 'index.html')
210
-
211
- config_path = File.join(test_dir, '_config.yml')
212
- config_content = "gems:\n - #{@settings[:name]}"
213
- write(config_path, config_content)
214
-
215
- clash_path = File.join(test_dir, '.clash.yml')
216
- clash_content = "title: Standard build\nbuild: true\ncompare: _expected _site"
217
- write(clash_path, clash_content)
218
-
219
- puts "#{action} #{index.sub("#{Dir.pwd}/", '')}"
220
- end
221
-
222
193
  def self.write(path, contents)
223
194
  action = File.exist?(path) ? "written".rjust(12).blue.bold : "create".rjust(12).green.bold
224
195
 
@@ -104,14 +104,25 @@ module Octopress
104
104
  copied.compact
105
105
  end
106
106
 
107
+ def sort(files, config)
108
+ sorted = []
109
+ config.each do |item|
110
+ files.each do |file|
111
+ sorted << files.delete(file) if file.path.to_s.include? item
112
+ end
113
+ end
114
+
115
+ sorted.concat files
116
+ end
117
+
107
118
  # stylesheets should include Sass and CSS
108
119
  #
109
120
  def stylesheets
110
- css.clone.concat sass_without_partials
121
+ sort(css.clone.concat(sass_without_partials), config['order_css'] || [])
111
122
  end
112
123
 
113
124
  def javascripts
114
- js.clone.concat coffee
125
+ sort(js.clone.concat(coffee), config['order_js'] || [])
115
126
  end
116
127
 
117
128
  def no_compress_js
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.41"
3
+ VERSION = "1.0.0.rc.42"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.41
4
+ version: 1.0.0.rc.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-14 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll