octopress-ink 1.0.0.alpha.33 → 1.0.0.alpha.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/assets/docs/food.html +0 -0
- data/assets/docs/index.html +0 -0
- data/lib/octopress-ink.rb +80 -27
- data/lib/octopress-ink/assets.rb +6 -1
- data/lib/octopress-ink/assets/asset.rb +54 -36
- data/lib/octopress-ink/assets/config.rb +10 -11
- data/lib/octopress-ink/assets/doc_page.rb +53 -0
- data/lib/octopress-ink/assets/file.rb +37 -0
- data/lib/octopress-ink/assets/javascript.rb +5 -1
- data/lib/octopress-ink/assets/layout.rb +8 -5
- data/lib/octopress-ink/assets/local_asset.rb +47 -0
- data/lib/octopress-ink/assets/local_javascript.rb +12 -0
- data/lib/octopress-ink/assets/local_sass.rb +30 -0
- data/lib/octopress-ink/assets/local_stylesheet.rb +33 -0
- data/lib/octopress-ink/assets/page.rb +19 -9
- data/lib/octopress-ink/assets/sass.rb +24 -19
- data/lib/octopress-ink/assets/stylesheet.rb +12 -6
- data/lib/octopress-ink/commands.rb +5 -2
- data/lib/octopress-ink/commands/copy.rb +29 -0
- data/lib/octopress-ink/commands/helpers.rb +12 -10
- data/lib/octopress-ink/commands/info.rb +5 -3
- data/lib/octopress-ink/configuration.rb +21 -0
- data/lib/octopress-ink/filters.rb +1 -1
- data/lib/octopress-ink/generators/plugin_assets.rb +2 -3
- data/lib/octopress-ink/jekyll/page.rb +15 -11
- data/lib/octopress-ink/plugin.rb +214 -109
- data/lib/octopress-ink/plugins.rb +74 -113
- data/lib/octopress-ink/plugins/asset_pipeline.rb +93 -0
- data/lib/octopress-ink/plugins/ink.rb +15 -0
- data/lib/octopress-ink/version.rb +1 -1
- data/octopress-ink.gemspec +1 -0
- data/test/Gemfile +0 -2
- data/test/_concat_false.yml +2 -0
- data/test/_sass_compact.yml +2 -3
- data/test/_sass_expanded.yml +2 -3
- data/test/concat_css_false/{awesome-sauce/stylesheets → stylesheets/awesome-sauce}/plugin-media-test.css +0 -0
- data/test/concat_css_false/{awesome-sauce/stylesheets → stylesheets/awesome-sauce}/plugin-test.css +0 -0
- data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-media-test.css +0 -0
- data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-test.css +0 -0
- data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-test2.css +0 -0
- data/test/concat_js/javascripts/all-d41d8cd98f00b204e9800998ecf8427e.js +3 -0
- data/test/concat_js_false/javascripts/site.js +1 -0
- data/test/concat_js_false/javascripts/theme/bar.js +1 -0
- data/test/concat_js_false/javascripts/theme/foo.js +1 -0
- data/test/copy_layouts_pages/_copy/layouts/default.html +12 -0
- data/test/copy_layouts_pages/_copy/layouts/test.html +4 -0
- data/test/copy_layouts_pages/_copy/pages/disable-test.html +3 -0
- data/test/copy_layouts_pages/_copy/pages/one.xml +4 -0
- data/test/copy_layouts_pages/_copy/pages/three.md +5 -0
- data/test/copy_layouts_pages/_copy/pages/two.md +6 -0
- data/test/copy_test/_copy/files/disabled-file.txt +2 -0
- data/test/copy_test/_copy/files/favicon.ico +1 -0
- data/test/copy_test/_copy/files/favicon.png +1 -0
- data/test/copy_test/_copy/fonts/font-one.otf +1 -0
- data/test/copy_test/_copy/fonts/font-two.ttf +1 -0
- data/test/copy_test/_copy/includes/bar.html +2 -0
- data/test/copy_test/_copy/includes/greet.html +1 -0
- data/test/copy_test/_copy/javascripts/bar.js +1 -0
- data/test/copy_test/_copy/javascripts/disable-this.js +1 -0
- data/test/copy_test/_copy/javascripts/foo.js +1 -0
- data/test/copy_test/_copy/layouts/default.html +12 -0
- data/test/copy_test/_copy/layouts/test.html +4 -0
- data/test/copy_test/_copy/pages/disable-test.html +3 -0
- data/test/copy_test/_copy/pages/one.xml +4 -0
- data/test/copy_test/_copy/pages/three.md +5 -0
- data/test/copy_test/_copy/pages/two.md +6 -0
- data/test/copy_test/_copy/stylesheets/disable-this.css +1 -0
- data/test/copy_test/_copy/stylesheets/disable.sass +1 -0
- data/test/copy_test/_copy/stylesheets/main.scss +2 -0
- data/test/copy_test/_copy/stylesheets/theme-media-test@print.css +1 -0
- data/test/copy_test/_copy/stylesheets/theme-test.css +4 -0
- data/test/copy_test/_copy/stylesheets/theme-test2.css +3 -0
- data/test/plugins/awesome-sauce/docs/index.html +0 -0
- data/test/plugins/awesome-sauce/pages/test_pages/one.html +1 -1
- data/test/plugins/awesome-sauce/pages/test_pages/two.html +1 -1
- data/test/plugins/awesome-sauce/plugin.rb +2 -3
- data/test/plugins/test-theme/config.yml +1 -1
- data/test/plugins/test-theme/files/disabled-file.txt +2 -0
- data/test/plugins/test-theme/fonts/font-one.otf +1 -0
- data/test/plugins/test-theme/fonts/font-two.ttf +1 -0
- data/test/plugins/test-theme/javascripts/disable-this.js +1 -0
- data/test/plugins/test-theme/pages/disable-test.html +3 -0
- data/test/plugins/test-theme/pages/test_pages/disable-test.html +3 -0
- data/test/plugins/test-theme/pages/test_pages/two.md +1 -1
- data/test/plugins/test-theme/plugin.rb +4 -4
- data/test/plugins/test-theme/stylesheets/disable-this.css +1 -0
- data/test/plugins/test-theme/stylesheets/disable.sass +1 -0
- data/test/sass_compact/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +1 -1
- data/test/sass_expanded/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +1 -1
- data/test/source/_javascripts/site.js +1 -0
- data/test/source/_plugins/awesome-sauce/config.yml +5 -1
- data/test/source/_plugins/theme/config.yml +11 -1
- data/test/source/{stylesheets → _stylesheets}/_foo.scss +0 -0
- data/test/source/{stylesheets → _stylesheets}/site.sass +0 -0
- data/test/source/{stylesheets → _stylesheets}/test.css +0 -0
- data/test/test.rb +87 -37
- metadata +130 -23
- data/lib/octopress-ink/assets/include.rb +0 -18
- data/lib/octopress-ink/assets/root.rb +0 -29
- data/lib/octopress-ink/plugins/stylesheets.rb +0 -56
- data/test/_concat_css_false.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d1a4f5b802349cd448e8a704fca49677a8fa365
|
4
|
+
data.tar.gz: 2762503e84829b574d8763548c38c2b9fec56b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 877d1fbd6cc33054a5fe2be3d966174b34fda93c35486c33a077a043c5594794c1b05d9feca6b1a84cd46dca70675b38afa10695e36935f40c62f21063a95528
|
7
|
+
data.tar.gz: c12a7d2635f8052c52e508eb57110d8f0f813f663ae9c84c06e7a3e423f80d21601db9f30d779cd1074a9f8c9b33ea5a21fa68d1e06593d1c7dcdc5c006a50b9
|
data/.travis.yml
CHANGED
File without changes
|
File without changes
|
data/lib/octopress-ink.rb
CHANGED
@@ -10,6 +10,8 @@ require 'octopress-ink/helpers/titlecase'
|
|
10
10
|
|
11
11
|
module Octopress
|
12
12
|
module Ink
|
13
|
+
|
14
|
+
autoload :Configuration, 'octopress-ink/configuration'
|
13
15
|
autoload :Helpers, 'octopress-ink/helpers'
|
14
16
|
autoload :Filters, 'octopress-ink/filters'
|
15
17
|
autoload :Assets, 'octopress-ink/assets'
|
@@ -19,15 +21,14 @@ module Octopress
|
|
19
21
|
autoload :Plugins, 'octopress-ink/plugins'
|
20
22
|
autoload :Plugin, 'octopress-ink/plugin'
|
21
23
|
autoload :Tags, 'octopress-ink/tags'
|
22
|
-
autoload :StylesheetsPlugin, 'octopress-ink/plugins/stylesheets'
|
23
24
|
|
24
25
|
if defined? Octopress::Command
|
25
26
|
require 'octopress-ink/commands/helpers'
|
26
27
|
require 'octopress-ink/commands'
|
27
28
|
end
|
28
29
|
|
29
|
-
def self.register_plugin(plugin, name, type='plugin')
|
30
|
-
Plugins.register_plugin(plugin, name, type)
|
30
|
+
def self.register_plugin(plugin, name, type='plugin', local=nil)
|
31
|
+
Plugins.register_plugin(plugin, name, type, local)
|
31
32
|
end
|
32
33
|
|
33
34
|
def self.version
|
@@ -38,58 +39,106 @@ module Octopress
|
|
38
39
|
version << "Octopress Ink v#{Octopress::Ink::VERSION}"
|
39
40
|
end
|
40
41
|
|
41
|
-
def self.
|
42
|
+
def self.config
|
43
|
+
Configuration.config
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.site(options={})
|
42
47
|
log_level = Jekyll.logger.log_level
|
43
48
|
Jekyll.logger.log_level = Jekyll::Stevenson::WARN
|
44
|
-
@site ||= Jekyll::Site.new(Jekyll.configuration(
|
49
|
+
@site ||= Jekyll::Site.new(Jekyll.configuration(options))
|
45
50
|
Jekyll.logger.log_level = log_level
|
46
51
|
@site
|
47
52
|
end
|
48
53
|
|
49
54
|
def self.plugins
|
50
|
-
|
51
|
-
s = site #spin up Jekyll to load all plugins
|
52
|
-
@plugins = Plugins
|
53
|
-
@plugins.site = s
|
54
|
-
@plugins
|
55
|
+
Plugins.plugins
|
55
56
|
end
|
56
57
|
|
57
58
|
def self.plugin(name)
|
58
59
|
begin
|
59
|
-
|
60
|
+
Plugins.plugin(name)
|
60
61
|
rescue
|
61
62
|
return false
|
62
63
|
end
|
63
64
|
end
|
65
|
+
|
66
|
+
# Prints a list of plugins and details
|
67
|
+
#
|
68
|
+
# options - a Hash of options from the Info command
|
69
|
+
#
|
70
|
+
# Note: if options are empty, this will display a
|
71
|
+
# list of plugin names, versions, and descriptions,
|
72
|
+
# but no assets, i.e. 'minimal' info.
|
73
|
+
#
|
74
|
+
#
|
75
|
+
def self.info(options={})
|
76
|
+
Plugins.register site(options)
|
77
|
+
options = {'minimal'=>true} if options.empty?
|
78
|
+
message = "Octopress Ink - v#{VERSION}\n"
|
79
|
+
|
80
|
+
if plugins.size > 0
|
81
|
+
plugins.each do |plugin|
|
82
|
+
message += plugin.info(options)
|
83
|
+
end
|
84
|
+
else
|
85
|
+
message += "You have no plugins installed."
|
86
|
+
end
|
87
|
+
puts message
|
88
|
+
end
|
64
89
|
|
65
90
|
def self.plugin_info(name, options)
|
91
|
+
Plugins.register site(options)
|
92
|
+
options.delete('config')
|
66
93
|
if p = plugin(name)
|
67
|
-
p.info(options)
|
94
|
+
puts p.info(options)
|
95
|
+
else
|
96
|
+
not_found(name)
|
68
97
|
end
|
69
98
|
end
|
70
|
-
|
71
|
-
def self.
|
72
|
-
|
73
|
-
if
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
name += ' (theme)' if plugin.type == 'theme'
|
78
|
-
message += "- #{name} ".ljust(30)
|
79
|
-
message += "v#{plugin.version} - " if plugin.version
|
80
|
-
message += plugin.description if plugin.description
|
81
|
-
message += "\n"
|
99
|
+
|
100
|
+
def self.copy_plugin_assets(name, path, options)
|
101
|
+
Plugins.register site(options)
|
102
|
+
if path
|
103
|
+
full_path = File.join(Plugins.site.source, path)
|
104
|
+
if !Dir["#{full_path}/*"].empty? && options['force'].nil?
|
105
|
+
abort "Error: directory #{path} is not empty. Use --force to overwrite files."
|
82
106
|
end
|
83
107
|
else
|
84
|
-
|
108
|
+
full_path = File.join(Plugins.site.source, Plugins.custom_dir, name)
|
109
|
+
end
|
110
|
+
if p = plugin(name)
|
111
|
+
copied = p.copy_asset_files(full_path, options)
|
112
|
+
if !copied.empty?
|
113
|
+
puts "Copied files:\n#{copied.join("\n")}"
|
114
|
+
else
|
115
|
+
puts "No files copied from #{name}."
|
116
|
+
end
|
117
|
+
else
|
118
|
+
not_found(name)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.not_found(plugin)
|
123
|
+
puts "Plugin '#{plugin}' not found."
|
124
|
+
list_plugins
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.list_plugins(options={})
|
128
|
+
Plugins.register site(options)
|
129
|
+
puts "\nCurrently installed plugins:"
|
130
|
+
if plugins.size > 0
|
131
|
+
plugins.each { |plugin| puts plugin.name }
|
132
|
+
else
|
133
|
+
puts "You have no plugins installed."
|
85
134
|
end
|
86
|
-
puts message
|
87
135
|
end
|
88
136
|
end
|
89
137
|
end
|
90
138
|
|
91
139
|
Liquid::Template.register_filter Octopress::Ink::Filters
|
92
140
|
|
141
|
+
|
93
142
|
Liquid::Template.register_tag('include', Octopress::Ink::Tags::IncludeTag)
|
94
143
|
Liquid::Template.register_tag('assign', Octopress::Ink::Tags::AssignTag)
|
95
144
|
Liquid::Template.register_tag('capture', Octopress::Ink::Tags::CaptureTag)
|
@@ -104,5 +153,9 @@ Liquid::Template.register_tag('wrap', Octopress::Ink::Tags::WrapTag)
|
|
104
153
|
Liquid::Template.register_tag('abort', Octopress::Ink::Tags::AbortTag)
|
105
154
|
Liquid::Template.register_tag('_', Octopress::Ink::Tags::LineCommentTag)
|
106
155
|
|
107
|
-
|
156
|
+
require 'octopress-ink/plugins/ink'
|
157
|
+
require 'octopress-ink/plugins/asset_pipeline'
|
158
|
+
|
159
|
+
Octopress::Ink.register_plugin(Ink, 'ink', 'plugin')
|
160
|
+
Octopress::Ink.register_plugin(Octopress::Ink::AssetPipelinePlugin, 'asset-pipeline', 'plugin', true)
|
108
161
|
|
data/lib/octopress-ink/assets.rb
CHANGED
@@ -2,12 +2,17 @@ module Octopress
|
|
2
2
|
module Ink
|
3
3
|
module Assets
|
4
4
|
autoload :Asset, 'octopress-ink/assets/asset'
|
5
|
+
autoload :LocalAsset, 'octopress-ink/assets/local_asset'
|
5
6
|
autoload :Config, 'octopress-ink/assets/config'
|
6
|
-
autoload :
|
7
|
+
autoload :FileAsset, 'octopress-ink/assets/file'
|
7
8
|
autoload :PageAsset, 'octopress-ink/assets/page'
|
9
|
+
autoload :DocPageAsset, 'octopress-ink/assets/doc_page'
|
8
10
|
autoload :Javascript, 'octopress-ink/assets/javascript'
|
9
11
|
autoload :Stylesheet, 'octopress-ink/assets/stylesheet'
|
12
|
+
autoload :LocalStylesheet, 'octopress-ink/assets/local_stylesheet'
|
13
|
+
autoload :LocalJavascript, 'octopress-ink/assets/local_javascript'
|
10
14
|
autoload :Sass, 'octopress-ink/assets/sass'
|
15
|
+
autoload :LocalSass, 'octopress-ink/assets/local_sass'
|
11
16
|
autoload :Include, 'octopress-ink/assets/include'
|
12
17
|
autoload :Layout, 'octopress-ink/assets/layout'
|
13
18
|
end
|
@@ -2,93 +2,111 @@ module Octopress
|
|
2
2
|
module Ink
|
3
3
|
module Assets
|
4
4
|
class Asset
|
5
|
+
attr_reader :plugin, :dir, :base, :root, :file
|
6
|
+
attr_accessor :exists
|
5
7
|
|
6
|
-
def initialize(plugin,
|
8
|
+
def initialize(plugin, base, file)
|
7
9
|
@file = file
|
8
|
-
@
|
10
|
+
@base = base
|
9
11
|
@plugin = plugin
|
10
12
|
@root = plugin.assets_path
|
11
|
-
@dir = File.join(plugin.slug,
|
13
|
+
@dir = File.join(plugin.slug, base)
|
12
14
|
@exists = {}
|
13
15
|
file_check
|
14
16
|
end
|
15
17
|
|
16
18
|
def info
|
17
|
-
message = filename.ljust(
|
18
|
-
if
|
19
|
-
|
20
|
-
|
19
|
+
message = filename.ljust(35)
|
20
|
+
if disabled?
|
21
|
+
message += "disabled"
|
22
|
+
elsif self.respond_to?(:url_info)
|
23
|
+
message += url_info
|
24
|
+
elsif path.to_s != plugin_path
|
25
|
+
shortpath = File.join(Plugins.custom_dir, dir)
|
26
|
+
message += "from: #{shortpath}/#{filename}"
|
21
27
|
end
|
22
28
|
message
|
23
29
|
end
|
24
30
|
|
25
31
|
def filename
|
26
|
-
|
32
|
+
file
|
33
|
+
end
|
34
|
+
|
35
|
+
def disabled?
|
36
|
+
plugin.disabled?(base, filename)
|
27
37
|
end
|
28
38
|
|
29
39
|
def path
|
30
|
-
if @found_file
|
40
|
+
if @found_file
|
31
41
|
@found_file
|
32
42
|
else
|
33
43
|
files = []
|
34
44
|
files << user_path
|
35
|
-
files << plugin_path
|
45
|
+
files << plugin_path
|
36
46
|
files = files.flatten.reject { |f| !exists? f }
|
37
47
|
|
38
48
|
if files.empty?
|
39
|
-
raise IOError.new "Could not find #{File.basename(
|
49
|
+
raise IOError.new "Could not find #{File.basename(file)} at #{file}"
|
40
50
|
end
|
41
51
|
@found_file = Pathname.new files[0]
|
42
52
|
end
|
43
53
|
end
|
44
54
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
55
|
+
def source_dir
|
56
|
+
if exists? user_override_path
|
57
|
+
user_dir
|
58
|
+
else
|
59
|
+
plugin_dir
|
60
|
+
end
|
48
61
|
end
|
49
62
|
|
50
63
|
def destination
|
51
|
-
File.join(
|
64
|
+
File.join(dir, file)
|
52
65
|
end
|
53
66
|
|
54
|
-
def
|
67
|
+
def add
|
55
68
|
Plugins.site.static_files << StaticFile.new(path, destination)
|
56
69
|
end
|
57
70
|
|
71
|
+
# Copy asset to user override directory
|
72
|
+
#
|
73
|
+
def copy(target_dir)
|
74
|
+
if target_dir
|
75
|
+
target_dir = File.join(target_dir, base)
|
76
|
+
else
|
77
|
+
target_dir = user_dir
|
78
|
+
end
|
79
|
+
FileUtils.mkdir_p target_dir
|
80
|
+
FileUtils.cp plugin_path, target_dir
|
81
|
+
target_dir.sub!(Dir.pwd+'/', '')
|
82
|
+
"+ ".green + "#{File.join(target_dir, filename)}"
|
83
|
+
end
|
84
|
+
|
85
|
+
|
58
86
|
def plugin_dir
|
59
|
-
File.join
|
87
|
+
File.join root, base
|
60
88
|
end
|
61
89
|
|
62
90
|
def plugin_path
|
63
|
-
File.join plugin_dir,
|
91
|
+
File.join plugin_dir, file
|
64
92
|
end
|
65
93
|
|
66
94
|
def user_dir
|
67
|
-
File.join Plugins.site.source, Plugins.custom_dir,
|
95
|
+
File.join Plugins.site.source, Plugins.custom_dir, dir
|
68
96
|
end
|
69
97
|
|
70
98
|
def local_plugin_path
|
71
|
-
File.join Plugins.site.source,
|
99
|
+
File.join Plugins.site.source, dir, file
|
72
100
|
end
|
73
101
|
|
74
102
|
def user_override_path
|
75
|
-
File.join user_dir,
|
103
|
+
File.join user_dir, filename
|
76
104
|
end
|
77
105
|
|
78
106
|
def user_path
|
79
|
-
|
80
|
-
local_plugin_path
|
81
|
-
else
|
82
|
-
user_override_path
|
83
|
-
end
|
107
|
+
user_override_path
|
84
108
|
end
|
85
109
|
|
86
|
-
def alt_syntax_file
|
87
|
-
ext = File.extname(@file)
|
88
|
-
alt_ext = ext == 'scss' ? 'sass' : 'scss'
|
89
|
-
@file.sub(/\.#{ext}/, ".#{alt_ext}")
|
90
|
-
end
|
91
|
-
|
92
110
|
# Remove files from Jekyll's static_files array so it doesn't end up in the
|
93
111
|
# compiled site directory.
|
94
112
|
#
|
@@ -101,14 +119,14 @@ module Octopress
|
|
101
119
|
end
|
102
120
|
|
103
121
|
def file_check
|
104
|
-
if
|
105
|
-
raise "\nPlugin: #{
|
122
|
+
if !exists? plugin_path
|
123
|
+
raise "\nPlugin: #{plugin.name}: Could not find #{File.basename(file)} at #{plugin_path}".red
|
106
124
|
end
|
107
125
|
end
|
108
126
|
|
109
127
|
def exists?(file)
|
110
|
-
|
111
|
-
|
128
|
+
exists[file] ||= File.exists?(file)
|
129
|
+
exists[file]
|
112
130
|
end
|
113
131
|
end
|
114
132
|
end
|
@@ -7,31 +7,30 @@ module Octopress
|
|
7
7
|
@root = plugin.assets_path
|
8
8
|
@plugin = plugin
|
9
9
|
@dir = plugin.slug
|
10
|
-
@
|
10
|
+
@base = ''
|
11
11
|
@exists = {}
|
12
12
|
@file = path
|
13
13
|
end
|
14
14
|
|
15
15
|
def user_dir
|
16
|
-
File.join Plugins.site.source, Plugins.custom_dir,
|
16
|
+
File.join Plugins.site.source, Plugins.custom_dir, dir
|
17
17
|
end
|
18
18
|
|
19
19
|
def local_plugin_path
|
20
|
-
File.join Plugins.site.source,
|
20
|
+
File.join Plugins.site.source, dir, file
|
21
21
|
end
|
22
22
|
|
23
23
|
def read
|
24
24
|
config = {}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
config = YAML.safe_load(File.open(default))
|
29
|
-
end
|
25
|
+
default = plugin_path
|
26
|
+
if exists? default
|
27
|
+
config = YAML.safe_load(File.open(default))
|
30
28
|
end
|
31
|
-
|
32
|
-
if exists?
|
33
|
-
config = config.deep_merge YAML.safe_load(File.open(
|
29
|
+
|
30
|
+
if exists? user_path
|
31
|
+
config = config.deep_merge YAML.safe_load(File.open(user_path))
|
34
32
|
end
|
33
|
+
|
35
34
|
config
|
36
35
|
end
|
37
36
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# These are files which need to be in added to the root of the site directory
|
2
|
+
# Use root assets for files like robots.text or favicon.ico
|
3
|
+
|
4
|
+
module Octopress
|
5
|
+
module Ink
|
6
|
+
module Assets
|
7
|
+
class DocPageAsset < Asset
|
8
|
+
attr_reader :filename
|
9
|
+
|
10
|
+
def initialize(plugin, base, file)
|
11
|
+
@root = plugin.assets_path
|
12
|
+
@plugin = plugin
|
13
|
+
@base = base
|
14
|
+
@filename = file
|
15
|
+
@dir = File.dirname(file)
|
16
|
+
@file = File.basename(file)
|
17
|
+
@exists = {}
|
18
|
+
file_check
|
19
|
+
end
|
20
|
+
|
21
|
+
def page_dir
|
22
|
+
dir == '.' ? '' : dir
|
23
|
+
end
|
24
|
+
|
25
|
+
def plugin_path
|
26
|
+
File.join(plugin_dir, dir, file)
|
27
|
+
end
|
28
|
+
|
29
|
+
def source_dir
|
30
|
+
File.join root, base
|
31
|
+
end
|
32
|
+
|
33
|
+
def path
|
34
|
+
File.join(plugin_dir, page_dir, file)
|
35
|
+
end
|
36
|
+
|
37
|
+
def page
|
38
|
+
@page ||= Page.new(Plugins.site, source_dir, page_dir, file, {'path'=>plugin.docs_base_path})
|
39
|
+
end
|
40
|
+
|
41
|
+
# Add doc page to Jekyll pages
|
42
|
+
#
|
43
|
+
def add
|
44
|
+
if Ink.config['docs_mode']
|
45
|
+
page.data['layout'] = 'docs'
|
46
|
+
Plugins.site.pages << page
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|