octopress-ink 1.0.0.rc.18 → 1.0.0.rc.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/octopress-ink/assets/layout.rb +1 -1
- data/lib/octopress-ink/assets/page.rb +1 -0
- data/lib/octopress-ink/configuration.rb +12 -20
- data/lib/octopress-ink/jekyll/convertible.rb +30 -0
- data/lib/octopress-ink/jekyll/layout.rb +23 -0
- data/lib/octopress-ink/jekyll/page.rb +1 -1
- data/lib/octopress-ink/plugin.rb +3 -3
- data/lib/octopress-ink/plugin_asset_pipeline.rb +3 -3
- data/lib/octopress-ink/plugins.rb +4 -4
- data/lib/octopress-ink/version.rb +1 -1
- data/lib/octopress-ink.rb +2 -11
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aa2d2440952a5f6b283baf69eb97ad02476a89d
|
4
|
+
data.tar.gz: 4ec408b10ddb22ff6fad321724109f0f93e5e855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c73835a88896db10a813a3d44fae35c464ab0ac5e501e7bd076c81b25d47212a879f89ab735f5e357f606596439b20c421c4e7ddd7603d87058f5e5f8924a0
|
7
|
+
data.tar.gz: d6162bf2dc6319d26329bcbd63287e21475bd87b39b25f578edf38c6e776e92fd37b91fe70bd4c2face3a88253b78272fbcbbdf1130b45333145e8c86d1bc6bd
|
data/CHANGELOG.md
CHANGED
@@ -2,29 +2,21 @@
|
|
2
2
|
require 'yaml'
|
3
3
|
|
4
4
|
module Octopress
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
module Ink
|
6
|
+
DEFAULT_OPTIONS = {
|
7
|
+
'combine_css' => true,
|
8
|
+
'compress_css' => true,
|
9
|
+
'combine_js' => true,
|
10
|
+
'compress_js' => true,
|
11
|
+
'uglifier' => {},
|
12
|
+
'disable' => [],
|
13
|
+
'date_format' => 'ordinal',
|
14
|
+
}
|
9
15
|
|
10
|
-
def
|
11
|
-
|
16
|
+
def self.configuration(options={})
|
17
|
+
@config ||= DEFAULT_OPTIONS.merge(Octopress.configuration(options))
|
12
18
|
end
|
13
|
-
end
|
14
19
|
|
15
|
-
module Ink
|
16
|
-
module Configuration
|
17
|
-
DEFAULTS = {
|
18
|
-
'docs_mode' => false,
|
19
|
-
'combine_css' => true,
|
20
|
-
'compress_css' => true,
|
21
|
-
'combine_js' => true,
|
22
|
-
'compress_js' => true,
|
23
|
-
'uglifier' => {},
|
24
|
-
'disable' => [],
|
25
|
-
'date_format' => 'ordinal',
|
26
|
-
}
|
27
|
-
end
|
28
20
|
end
|
29
21
|
end
|
30
22
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Ink
|
3
|
+
module Convertible
|
4
|
+
include Jekyll::Convertible
|
5
|
+
|
6
|
+
# Read the YAML frontmatter.
|
7
|
+
#
|
8
|
+
# base - The String path to the dir containing the file.
|
9
|
+
# name - The String filename of the file.
|
10
|
+
# opts - optional parameter to File.read, default at site configs
|
11
|
+
#
|
12
|
+
# Returns nothing.
|
13
|
+
def read_yaml(base, name, opts = {})
|
14
|
+
begin
|
15
|
+
self.content = File.read(File.join(base, name), merged_file_read_opts(opts))
|
16
|
+
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
17
|
+
self.content = $POSTMATCH
|
18
|
+
self.data = SafeYAML.load($1)
|
19
|
+
end
|
20
|
+
rescue SyntaxError => e
|
21
|
+
Jekyll.logger.warn "YAML Exception reading #{File.join(base, name)}: #{e.message}"
|
22
|
+
rescue Exception => e
|
23
|
+
Jekyll.logger.warn "Error reading file #{File.join(base, name)}: #{e.message}"
|
24
|
+
end
|
25
|
+
|
26
|
+
self.data ||= {}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Ink
|
3
|
+
class Layout < Jekyll::Layout
|
4
|
+
include Ink::Convertible
|
5
|
+
|
6
|
+
# Initialize a new Layout.
|
7
|
+
#
|
8
|
+
# site - The Site.
|
9
|
+
# base - The String path to the source.
|
10
|
+
# name - The String filename of the post file.
|
11
|
+
def initialize(site, base, name)
|
12
|
+
@site = site
|
13
|
+
@base = base
|
14
|
+
@name = name
|
15
|
+
|
16
|
+
self.data = {}
|
17
|
+
|
18
|
+
process(name)
|
19
|
+
read_yaml(base, name)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/octopress-ink/plugin.rb
CHANGED
@@ -8,7 +8,7 @@ module Octopress
|
|
8
8
|
type: 'plugin'
|
9
9
|
}
|
10
10
|
|
11
|
-
attr_reader :name, :type, :path, :assets_path, :local, :website, :description, :version,
|
11
|
+
attr_reader :name, :type, :path, :assets_path, :local, :website, :description, :version, :source_url, :website,
|
12
12
|
:layouts_dir, :stylesheets_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir,
|
13
13
|
:layouts, :includes, :images, :fonts, :files, :pages, :docs, :docs_url
|
14
14
|
|
@@ -49,9 +49,9 @@ module Octopress
|
|
49
49
|
add_assets
|
50
50
|
add_images
|
51
51
|
|
52
|
-
if
|
52
|
+
if ENV['OCTOPRESS_DOCS']
|
53
53
|
add_docs
|
54
|
-
|
54
|
+
else
|
55
55
|
add_includes
|
56
56
|
add_layouts
|
57
57
|
add_javascripts
|
@@ -7,7 +7,7 @@ module Octopress
|
|
7
7
|
def self.compile_css(content)
|
8
8
|
configs = sass_converter.sass_configs
|
9
9
|
configs[:syntax] = :scss
|
10
|
-
configs[:style] ||= :compressed if
|
10
|
+
configs[:style] ||= :compressed if Ink.configuration['compress_css']
|
11
11
|
|
12
12
|
Sass.compile(content, configs)
|
13
13
|
end
|
@@ -158,8 +158,8 @@ module Octopress
|
|
158
158
|
@combined_javascripts = nil
|
159
159
|
js = combine_javascripts
|
160
160
|
unless js == ''
|
161
|
-
if
|
162
|
-
settings = Jekyll::Utils.symbolize_hash_keys(
|
161
|
+
if Ink.configuration['compress_js']
|
162
|
+
settings = Jekyll::Utils.symbolize_hash_keys(Ink.configuration['uglifier'])
|
163
163
|
js = Uglifier.new(settings).compile(js)
|
164
164
|
end
|
165
165
|
write_files(js, combined_javascript_path)
|
@@ -117,7 +117,7 @@ module Octopress
|
|
117
117
|
# Copy/Generate Stylesheets
|
118
118
|
#
|
119
119
|
def self.add_stylesheets
|
120
|
-
if
|
120
|
+
if Ink.configuration['combine_css']
|
121
121
|
PluginAssetPipeline.write_combined_stylesheet
|
122
122
|
else
|
123
123
|
add_assets(%w{css sass})
|
@@ -127,7 +127,7 @@ module Octopress
|
|
127
127
|
# Copy/Generate Javascripts
|
128
128
|
#
|
129
129
|
def self.add_javascripts
|
130
|
-
if
|
130
|
+
if Ink.configuration['combine_js']
|
131
131
|
PluginAssetPipeline.write_combined_javascript
|
132
132
|
else
|
133
133
|
add_assets(%w{js coffee})
|
@@ -135,7 +135,7 @@ module Octopress
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def self.css_tags
|
138
|
-
if
|
138
|
+
if Ink.configuration['combine_css']
|
139
139
|
PluginAssetPipeline.combined_stylesheet_tag
|
140
140
|
else
|
141
141
|
@css_tags.join('')
|
@@ -143,7 +143,7 @@ module Octopress
|
|
143
143
|
end
|
144
144
|
|
145
145
|
def self.js_tags
|
146
|
-
if
|
146
|
+
if Ink.configuration['combine_js']
|
147
147
|
PluginAssetPipeline.combined_javascript_tag
|
148
148
|
else
|
149
149
|
@js_tags.join('')
|
data/lib/octopress-ink.rb
CHANGED
@@ -12,10 +12,6 @@ require 'octopress-ink/configuration'
|
|
12
12
|
require 'octopress-ink/jekyll/hooks'
|
13
13
|
|
14
14
|
module Octopress
|
15
|
-
def self.site(options={})
|
16
|
-
@site ||= init_site(options)
|
17
|
-
end
|
18
|
-
|
19
15
|
def self.site=(site)
|
20
16
|
# Octopress historically used site.title
|
21
17
|
# This allows theme developers to expect site.name
|
@@ -26,17 +22,12 @@ module Octopress
|
|
26
22
|
@site = site
|
27
23
|
end
|
28
24
|
|
29
|
-
def self.init_site(options)
|
30
|
-
Jekyll.logger.log_level = :error
|
31
|
-
site = Jekyll::Site.new(Jekyll.configuration(options))
|
32
|
-
Jekyll.logger.log_level = :info
|
33
|
-
site
|
34
|
-
end
|
35
|
-
|
36
25
|
module Ink
|
37
26
|
|
38
27
|
autoload :Assets, 'octopress-ink/assets'
|
28
|
+
autoload :Convertible, 'octopress-ink/jekyll/convertible'
|
39
29
|
autoload :Page, 'octopress-ink/jekyll/page'
|
30
|
+
autoload :Layout, 'octopress-ink/jekyll/layout'
|
40
31
|
autoload :StaticFile, 'octopress-ink/jekyll/static_file'
|
41
32
|
autoload :StaticFileContent, 'octopress-ink/jekyll/static_file_content'
|
42
33
|
autoload :Plugins, 'octopress-ink/plugins'
|
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.
|
4
|
+
version: 1.0.0.rc.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10
|
11
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -198,7 +198,9 @@ files:
|
|
198
198
|
- lib/octopress-ink/commands/list.rb
|
199
199
|
- lib/octopress-ink/commands/new.rb
|
200
200
|
- lib/octopress-ink/configuration.rb
|
201
|
+
- lib/octopress-ink/jekyll/convertible.rb
|
201
202
|
- lib/octopress-ink/jekyll/hooks.rb
|
203
|
+
- lib/octopress-ink/jekyll/layout.rb
|
202
204
|
- lib/octopress-ink/jekyll/page.rb
|
203
205
|
- lib/octopress-ink/jekyll/static_file.rb
|
204
206
|
- lib/octopress-ink/jekyll/static_file_content.rb
|