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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/assets/docs/food.html +0 -0
  4. data/assets/docs/index.html +0 -0
  5. data/lib/octopress-ink.rb +80 -27
  6. data/lib/octopress-ink/assets.rb +6 -1
  7. data/lib/octopress-ink/assets/asset.rb +54 -36
  8. data/lib/octopress-ink/assets/config.rb +10 -11
  9. data/lib/octopress-ink/assets/doc_page.rb +53 -0
  10. data/lib/octopress-ink/assets/file.rb +37 -0
  11. data/lib/octopress-ink/assets/javascript.rb +5 -1
  12. data/lib/octopress-ink/assets/layout.rb +8 -5
  13. data/lib/octopress-ink/assets/local_asset.rb +47 -0
  14. data/lib/octopress-ink/assets/local_javascript.rb +12 -0
  15. data/lib/octopress-ink/assets/local_sass.rb +30 -0
  16. data/lib/octopress-ink/assets/local_stylesheet.rb +33 -0
  17. data/lib/octopress-ink/assets/page.rb +19 -9
  18. data/lib/octopress-ink/assets/sass.rb +24 -19
  19. data/lib/octopress-ink/assets/stylesheet.rb +12 -6
  20. data/lib/octopress-ink/commands.rb +5 -2
  21. data/lib/octopress-ink/commands/copy.rb +29 -0
  22. data/lib/octopress-ink/commands/helpers.rb +12 -10
  23. data/lib/octopress-ink/commands/info.rb +5 -3
  24. data/lib/octopress-ink/configuration.rb +21 -0
  25. data/lib/octopress-ink/filters.rb +1 -1
  26. data/lib/octopress-ink/generators/plugin_assets.rb +2 -3
  27. data/lib/octopress-ink/jekyll/page.rb +15 -11
  28. data/lib/octopress-ink/plugin.rb +214 -109
  29. data/lib/octopress-ink/plugins.rb +74 -113
  30. data/lib/octopress-ink/plugins/asset_pipeline.rb +93 -0
  31. data/lib/octopress-ink/plugins/ink.rb +15 -0
  32. data/lib/octopress-ink/version.rb +1 -1
  33. data/octopress-ink.gemspec +1 -0
  34. data/test/Gemfile +0 -2
  35. data/test/_concat_false.yml +2 -0
  36. data/test/_sass_compact.yml +2 -3
  37. data/test/_sass_expanded.yml +2 -3
  38. data/test/concat_css_false/{awesome-sauce/stylesheets → stylesheets/awesome-sauce}/plugin-media-test.css +0 -0
  39. data/test/concat_css_false/{awesome-sauce/stylesheets → stylesheets/awesome-sauce}/plugin-test.css +0 -0
  40. data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-media-test.css +0 -0
  41. data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-test.css +0 -0
  42. data/test/concat_css_false/{theme/stylesheets → stylesheets/theme}/theme-test2.css +0 -0
  43. data/test/concat_js/javascripts/all-d41d8cd98f00b204e9800998ecf8427e.js +3 -0
  44. data/test/concat_js_false/javascripts/site.js +1 -0
  45. data/test/concat_js_false/javascripts/theme/bar.js +1 -0
  46. data/test/concat_js_false/javascripts/theme/foo.js +1 -0
  47. data/test/copy_layouts_pages/_copy/layouts/default.html +12 -0
  48. data/test/copy_layouts_pages/_copy/layouts/test.html +4 -0
  49. data/test/copy_layouts_pages/_copy/pages/disable-test.html +3 -0
  50. data/test/copy_layouts_pages/_copy/pages/one.xml +4 -0
  51. data/test/copy_layouts_pages/_copy/pages/three.md +5 -0
  52. data/test/copy_layouts_pages/_copy/pages/two.md +6 -0
  53. data/test/copy_test/_copy/files/disabled-file.txt +2 -0
  54. data/test/copy_test/_copy/files/favicon.ico +1 -0
  55. data/test/copy_test/_copy/files/favicon.png +1 -0
  56. data/test/copy_test/_copy/fonts/font-one.otf +1 -0
  57. data/test/copy_test/_copy/fonts/font-two.ttf +1 -0
  58. data/test/copy_test/_copy/includes/bar.html +2 -0
  59. data/test/copy_test/_copy/includes/greet.html +1 -0
  60. data/test/copy_test/_copy/javascripts/bar.js +1 -0
  61. data/test/copy_test/_copy/javascripts/disable-this.js +1 -0
  62. data/test/copy_test/_copy/javascripts/foo.js +1 -0
  63. data/test/copy_test/_copy/layouts/default.html +12 -0
  64. data/test/copy_test/_copy/layouts/test.html +4 -0
  65. data/test/copy_test/_copy/pages/disable-test.html +3 -0
  66. data/test/copy_test/_copy/pages/one.xml +4 -0
  67. data/test/copy_test/_copy/pages/three.md +5 -0
  68. data/test/copy_test/_copy/pages/two.md +6 -0
  69. data/test/copy_test/_copy/stylesheets/disable-this.css +1 -0
  70. data/test/copy_test/_copy/stylesheets/disable.sass +1 -0
  71. data/test/copy_test/_copy/stylesheets/main.scss +2 -0
  72. data/test/copy_test/_copy/stylesheets/theme-media-test@print.css +1 -0
  73. data/test/copy_test/_copy/stylesheets/theme-test.css +4 -0
  74. data/test/copy_test/_copy/stylesheets/theme-test2.css +3 -0
  75. data/test/plugins/awesome-sauce/docs/index.html +0 -0
  76. data/test/plugins/awesome-sauce/pages/test_pages/one.html +1 -1
  77. data/test/plugins/awesome-sauce/pages/test_pages/two.html +1 -1
  78. data/test/plugins/awesome-sauce/plugin.rb +2 -3
  79. data/test/plugins/test-theme/config.yml +1 -1
  80. data/test/plugins/test-theme/files/disabled-file.txt +2 -0
  81. data/test/plugins/test-theme/fonts/font-one.otf +1 -0
  82. data/test/plugins/test-theme/fonts/font-two.ttf +1 -0
  83. data/test/plugins/test-theme/javascripts/disable-this.js +1 -0
  84. data/test/plugins/test-theme/pages/disable-test.html +3 -0
  85. data/test/plugins/test-theme/pages/test_pages/disable-test.html +3 -0
  86. data/test/plugins/test-theme/pages/test_pages/two.md +1 -1
  87. data/test/plugins/test-theme/plugin.rb +4 -4
  88. data/test/plugins/test-theme/stylesheets/disable-this.css +1 -0
  89. data/test/plugins/test-theme/stylesheets/disable.sass +1 -0
  90. data/test/sass_compact/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +1 -1
  91. data/test/sass_expanded/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +1 -1
  92. data/test/source/_javascripts/site.js +1 -0
  93. data/test/source/_plugins/awesome-sauce/config.yml +5 -1
  94. data/test/source/_plugins/theme/config.yml +11 -1
  95. data/test/source/{stylesheets → _stylesheets}/_foo.scss +0 -0
  96. data/test/source/{stylesheets → _stylesheets}/site.sass +0 -0
  97. data/test/source/{stylesheets → _stylesheets}/test.css +0 -0
  98. data/test/test.rb +87 -37
  99. metadata +130 -23
  100. data/lib/octopress-ink/assets/include.rb +0 -18
  101. data/lib/octopress-ink/assets/root.rb +0 -29
  102. data/lib/octopress-ink/plugins/stylesheets.rb +0 -56
  103. data/test/_concat_css_false.yml +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46ae9894390869465465304356ec053b1ebe7f67
4
- data.tar.gz: 2ecea5df41464986d594bd3823a44054d5be951a
3
+ metadata.gz: 0d1a4f5b802349cd448e8a704fca49677a8fa365
4
+ data.tar.gz: 2762503e84829b574d8763548c38c2b9fec56b2f
5
5
  SHA512:
6
- metadata.gz: ef98087d515abd53e2161a59999de71b681a784cbb133a47c34cf61f68b3580cd413e47506056044ce1033ee6e21c421a1358752bd271a106ac375d3184f0a60
7
- data.tar.gz: 0c104ce6c0f8078b8f86105993378fec9841f10ca875e6c005afd1a960044538298064bcbc6a4a5666cef22a9ce0001980d3625673452c6e40182ef8b56960aa
6
+ metadata.gz: 877d1fbd6cc33054a5fe2be3d966174b34fda93c35486c33a077a043c5594794c1b05d9feca6b1a84cd46dca70675b38afa10695e36935f40c62f21063a95528
7
+ data.tar.gz: c12a7d2635f8052c52e508eb57110d8f0f813f663ae9c84c06e7a3e423f80d21601db9f30d779cd1074a9f8c9b33ea5a21fa68d1e06593d1c7dcdc5c006a50b9
data/.travis.yml CHANGED
@@ -2,5 +2,5 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
- script: cd test && ruby test.rb
5
+ script: cd test && bundle exec ruby test.rb
6
6
 
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.site
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
- return @plugins if @plugins
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
- plugins.plugin(name)
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.info
72
- message = "Octopress Ink - v#{VERSION}\n"
73
- if plugins.size > 0
74
- message += "Plugins:\n"
75
- plugins.each do |plugin|
76
- name = plugin.name
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
- message += "Plugins: none"
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
- Octopress::Ink.register_plugin(Octopress::Ink::StylesheetsPlugin, 'user stylesheets', 'local_plugin')
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
 
@@ -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 :RootAsset, 'octopress-ink/assets/root'
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, type, file)
8
+ def initialize(plugin, base, file)
7
9
  @file = file
8
- @type = type
10
+ @base = base
9
11
  @plugin = plugin
10
12
  @root = plugin.assets_path
11
- @dir = File.join(plugin.slug, type)
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(25)
18
- if path.to_s == user_path
19
- shortpath = File.join(Plugins.custom_dir, @dir)
20
- message += "(local @ #{shortpath}/#{filename})"
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
- @file
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 and !@no_cache
40
+ if @found_file
31
41
  @found_file
32
42
  else
33
43
  files = []
34
44
  files << user_path
35
- files << plugin_path unless @plugin.type == 'local_plugin'
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(@file)} at #{@file}"
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 file(file)
46
- @file = file
47
- path
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(@dir, @file)
64
+ File.join(dir, file)
52
65
  end
53
66
 
54
- def copy
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 @root, @type
87
+ File.join root, base
60
88
  end
61
89
 
62
90
  def plugin_path
63
- File.join plugin_dir, @file
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, @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, @dir, @file
99
+ File.join Plugins.site.source, dir, file
72
100
  end
73
101
 
74
102
  def user_override_path
75
- File.join user_dir, @file
103
+ File.join user_dir, filename
76
104
  end
77
105
 
78
106
  def user_path
79
- if @plugin.type == 'local_plugin'
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 @plugin.type != 'local_plugin' and !exists? plugin_path
105
- raise "\nPlugin: #{@plugin.name}: Could not find #{File.basename(@file)} at #{plugin_path}".red
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
- @exists[file] ||= File.exists?(file)
111
- @exists[file]
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
- @type = ''
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, @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, @dir, @file
20
+ File.join Plugins.site.source, dir, file
21
21
  end
22
22
 
23
23
  def read
24
24
  config = {}
25
- if @plugin.type != 'local_plugin'
26
- default = plugin_path
27
- if exists? default
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
- override = user_path
32
- if exists? override
33
- config = config.deep_merge YAML.safe_load(File.open(override))
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
+