octopress-asset-pipeline 2.0.4 → 2.0.5

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: 28d3d2a5aa564a1367af5711813e0993aa088604
4
- data.tar.gz: f218c29dcb6326153d6a0cf27158b35477e69143
3
+ metadata.gz: 8be2a62736676fde82afaa85afbb7a2e0cc7574c
4
+ data.tar.gz: 7d34940e4055544761aa7c4cca6a48d235243128
5
5
  SHA512:
6
- metadata.gz: 4d46a0ba7cb8e4d1176465668cb54245c7303b2a634820c0ccf440f93e7fdef53612d648698bbe8c731695f96194a255f81e6c8a41dddab718bd40c7e1736f36
7
- data.tar.gz: 94d56263a0afa3be3f8ac4076686d1476bd90063a8586015dc2e5d9fa1fbc583a18f17265284c87562866662fc81437ae8d80ba8ef883a8dda42b01cfee59afe
6
+ metadata.gz: 4fb6a81995a21c7a9db4009eed019ad77f35292581bd6b6feaf24567705be6f0c246113afa2e4e3a96a0441d70c1221def4c0780614a54676a5dcaa6e925c740
7
+ data.tar.gz: 55655fbb8187066561859cfe19ef04994f41c26542db101036168ff1390d3928cb53b600f8284f1fbab5b0bc42b02d03db457fc26171767fcc32e132c08e587e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.0.5 - 2015-05-24
4
+
5
+ - Now js and css files with YAML front-matter are now rendered as pages before added to asset pipeline.
6
+
3
7
  ### 2.0.4 - 2015-05-04
4
8
 
5
9
  - Updated dependency to latest Octopress Ink.
@@ -2,14 +2,15 @@ require 'octopress'
2
2
  require 'octopress-ink'
3
3
  require 'octopress-asset-pipeline/version'
4
4
 
5
- require 'octopress-asset-pipeline/assets/asset'
6
- require 'octopress-asset-pipeline/assets/css'
7
- require 'octopress-asset-pipeline/assets/sass'
8
- require 'octopress-asset-pipeline/assets/javascript'
9
- require 'octopress-asset-pipeline/assets/coffeescript'
10
-
11
5
  module Octopress
12
6
  module AssetPipeline
7
+
8
+ autoload :Asset, 'octopress-asset-pipeline/assets/asset'
9
+ autoload :Css, 'octopress-asset-pipeline/assets/css'
10
+ autoload :Sass, 'octopress-asset-pipeline/assets/sass'
11
+ autoload :Javascript, 'octopress-asset-pipeline/assets/javascript'
12
+ autoload :Coffeescript, 'octopress-asset-pipeline/assets/coffeescript'
13
+
13
14
  class Plugin < Ink::Plugin
14
15
  def register
15
16
  reset
@@ -109,13 +110,19 @@ module Octopress
109
110
  # Finds Sass and Coffeescript files files registered by Jekyll
110
111
  #
111
112
  def add_page_files
112
- find_page_assets(asset_dirs, '.scss', '.sass', '.coffee').each do |f|
113
+ find_page_assets(asset_dirs, '.scss', '.sass', '.coffee', '.js', '.css').each do |f|
113
114
  if f.ext =~ /\.coffee$/
114
115
  @coffee << Coffeescript.new(self, f)
115
116
  Octopress.site.pages.delete(f) if combine_js
116
117
  elsif f.ext =~ /\.s[ca]ss/
117
118
  @sass << Sass.new(self, f)
118
119
  Octopress.site.pages.delete(f) if combine_css
120
+ elsif f.ext =~ /\.css/
121
+ @css << Css.new(self, f)
122
+ Octopress.site.pages.delete(f) if combine_css
123
+ elsif f.ext =~ /\.js/
124
+ @js << Javascript.new(self, f)
125
+ Octopress.site.pages.delete(f) if combine_js
119
126
  end
120
127
  end
121
128
  end
@@ -16,6 +16,17 @@ module Octopress
16
16
  def output_file_name
17
17
  filename.sub(/@/,'-')
18
18
  end
19
+
20
+ def content
21
+ @render ||= begin
22
+ contents = super
23
+ if asset_payload = payload
24
+ Liquid::Template.parse(contents).render!(payload)
25
+ else
26
+ contents
27
+ end
28
+ end
29
+ end
19
30
  end
20
31
  end
21
32
  end
@@ -4,6 +4,17 @@ module Octopress
4
4
  def tag
5
5
  "<script src='#{Filters.expand_url(destination)}'></script>"
6
6
  end
7
+
8
+ def content
9
+ @render ||= begin
10
+ contents = super
11
+ if asset_payload = payload
12
+ Liquid::Template.parse(contents).render!(payload)
13
+ else
14
+ contents
15
+ end
16
+ end
17
+ end
7
18
  end
8
19
  end
9
20
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module AssetPipeline
3
- VERSION = "2.0.4"
3
+ VERSION = "2.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-asset-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
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-05-04 00:00:00.000000000 Z
11
+ date: 2015-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-ink