octopress-ink 1.0.0.alpha.43 → 1.0.0.alpha.44

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/assets/docs/creating-a-plugin.markdown +31 -42
  3. data/assets/docs/plugin-reference.markdown +1 -1
  4. data/lib/octopress-ink.rb +17 -5
  5. data/lib/octopress-ink/assets/page.rb +1 -1
  6. data/lib/octopress-ink/commands.rb +2 -0
  7. data/lib/octopress-ink/commands/copy.rb +7 -7
  8. data/lib/octopress-ink/commands/list.rb +4 -4
  9. data/lib/octopress-ink/commands/new.rb +160 -0
  10. data/lib/octopress-ink/jekyll/page.rb +4 -4
  11. data/lib/octopress-ink/plugin.rb +39 -27
  12. data/lib/octopress-ink/plugins.rb +2 -2
  13. data/lib/octopress-ink/version.rb +1 -1
  14. data/test/copy_layouts_pages/_copy/pages/four.xml +5 -0
  15. data/test/copy_layouts_pages/_copy/pages/one.xml +1 -1
  16. data/test/copy_layouts_pages/_copy/pages/three.md +1 -0
  17. data/test/copy_layouts_pages/_copy/pages/two.md +1 -1
  18. data/test/copy_test/_copy/pages/four.xml +5 -0
  19. data/test/copy_test/_copy/pages/one.xml +1 -1
  20. data/test/copy_test/_copy/pages/three.md +1 -0
  21. data/test/copy_test/_copy/pages/two.md +1 -1
  22. data/test/expected/four/index.xml +1 -0
  23. data/test/plugins/awesome-sauce/pages/{test_pages/one.html → a.html} +1 -1
  24. data/test/plugins/awesome-sauce/pages/b.html +4 -0
  25. data/test/plugins/awesome-sauce/plugin.rb +6 -13
  26. data/test/plugins/test-theme/config.yml +0 -3
  27. data/test/plugins/test-theme/pages/four.xml +5 -0
  28. data/test/plugins/test-theme/pages/one.xml +4 -0
  29. data/test/plugins/test-theme/pages/{test_pages/three.md → three.md} +1 -0
  30. data/test/plugins/test-theme/pages/{test_pages/two.md → two.md} +0 -1
  31. data/test/plugins/test-theme/plugin.rb +6 -12
  32. data/test/sass_compact/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +2 -2
  33. data/test/sass_compact/stylesheets/print-0dc274efb4e3fba0ae71bd22eef6fb38.css +2 -0
  34. data/test/sass_expanded/stylesheets/all-e10f647557c9d610df6df40a458bc823.css +2 -2
  35. data/test/sass_expanded/stylesheets/print-0dc274efb4e3fba0ae71bd22eef6fb38.css +2 -0
  36. data/test/source/_plugins/awesome-sauce/config.yml +3 -7
  37. data/test/source/_plugins/theme/config.yml +3 -4
  38. data/test/test.rb +7 -7
  39. metadata +21 -15
  40. data/assets/docs/creating-a-gem.markdown +0 -69
  41. data/test/plugins/awesome-sauce/pages/test_pages/two.html +0 -4
  42. data/test/plugins/test-theme/pages/test_pages/disable-test.html +0 -3
  43. data/test/plugins/test-theme/pages/test_pages/one.xml +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db0b53411b0e6748e5281e9db9fa6ef247296b9e
4
- data.tar.gz: 8ff58d71d3cd6c9b75ba143e072fca4ce169b906
3
+ metadata.gz: 0ddd087cd3f779c18b523d5f4feccfcb3b575b2f
4
+ data.tar.gz: 12126d852db51f062a0063516819319f554de313
5
5
  SHA512:
6
- metadata.gz: 1c455972095fe4418cfaf5ec2e70c3a6cb1785cf8d0cd29989d433425240532aa3f62b92098c02d9316844bfbe62ee963ae05758fd74d21cfa799303d169eb56
7
- data.tar.gz: f9e610a3b80b20731db06b95f43931988167fd2b9b58190703f6d029bc58bb600250085f96497e0e1459f65af08d7d38f313ef6829a106a4659ef21e58d3c8eb
6
+ metadata.gz: 141cf68d224be24a4e57860e87584dac4af215dbe0a9f2aa9b7e83f2bb9e2b5ebbb30abf7c11738290fed5077fb2088ae2eb71dfe01a1a3cca49e94bc772aa27
7
+ data.tar.gz: e0bdf61520091974cfebe8cd353cffa5a5dd8d5c0bdd6bbdd8b9b8fb6c1e52423018042bf74570cd56328dd621886e6877ed7c9a8d2c603ee76264510eb1b55f
@@ -3,55 +3,44 @@ title: "Create an Octopress Ink Plugin"
3
3
  permalink: /guides/creating-a-plugin/
4
4
  ---
5
5
 
6
- If you haven't created a ruby gem for your plugin, check out [Creating a Gem]({% doc_url /guides/creating-a-gem/ %}).
6
+ *This guide assumes you have already installed Git, and Ruby 1.9.3 or greater.*
7
7
 
8
- In this section we'll create an Octopress Ink plugin. Take a look at `lib/baconnaise.rb`. You should see
9
- something like this:
8
+ Octopress Ink plugins are distributed as ruby gems so you'll probably need to create an acconut at [RubyGems.org](https://rubygems.org/sign_up) if you haven't yet. Also, be sure to install the [bundler](http://bundler.io) gem.
10
9
 
11
- ```ruby
12
- require "baconnaise/version"
10
+ ## Creating a Plugin
13
11
 
14
- module Baconnaise
15
- # Your code goes here...
16
- end
17
- ```
18
-
19
- We'll require octopress-ink add a configuration method, and register the plugin with Octopress Ink plugin. Here's what `lib/baconnaise.rb` after we've done that.
12
+ To create a new plugin from scratch run:
20
13
 
21
- ```ruby
22
- require "baconnaise/version"
23
- require "octopress-ink"
14
+ ```sh
15
+ octopress ink new cool_plugin
16
+ ```
24
17
 
25
- module Baconnaise
26
- class InkPlugin < Octopress::Ink::Plugin
27
- def configuration
28
- {
29
- # your configuration goes here.
30
- }
31
- end
32
- end
33
- end
18
+ This will add scaffolding for a gem-based plugin in the `cool_plugin` directory. To create a theme, add the `--theme` flag. Here's what that will look like.
34
19
 
35
- # Register the plugin with Octopress Ink
36
- Octopress::Ink.register_plugin(Baconnaise::InkPlugin)
20
+ ```
21
+ assets/
22
+ files/
23
+ fonts/
24
+ images/
25
+ includes/
26
+ javascripts/
27
+ layouts/
28
+ pages/
29
+ stylesheets/
30
+ lib/
31
+ cool_plugin/
32
+ version.rb
33
+ cool_plugin.rb
34
+ cool_plugin.gemspec
35
+ Gemfile
36
+ LICENSE.txt
37
+ Rakefile
38
+ README.md
37
39
  ```
38
40
 
39
- Now when Jekyll requires your plugin, it will register with Octopress Ink. The configuration options are as follows:
40
-
41
- {% render ./_configuration.markdown %}
41
+ This is basically Bundler's gem scaffolding with a few additions.
42
42
 
43
- For Baconnaise, our configuration medthod will look like this:
43
+ - Empty asset directories are added.
44
+ - The gemspec requires `octopress-ink` as a runtime dependency.
45
+ - A basic Octopress Ink plugin is added to `lib/cool_plugin.rb`.
44
46
 
45
- ```ruby
46
- def configuration
47
- {
48
- name: "Baconnaise",
49
- slug: "baconnaise",
50
- assets_path: File.expand_path(File.join(File.dirname(__FILE__), '../assets')),
51
- type: "plugin",
52
- version: Baconnaise::VERSION,
53
- description: "Baconnaise, because mistakes have never been this spreadable.",
54
- website: "http://baconnaise-craze.info/or/something/"
55
- }
56
- end
57
- ```
@@ -3,7 +3,7 @@ title: "Octopress Ink Plugin Reference"
3
3
  permalink: /plugin-reference/
4
4
  ---
5
5
 
6
- Octopress Ink plugins should be distributed as ruby gems. If you don't know how to create a ruby gem, [follow this walkthrough]({% doc_url /guides/create-a-gem/ %}).
6
+ Octopress Ink plugins should be distributed as Ruby gems. If you don't know how to create a ruby gem, [follow this walkthrough]({% doc_url /guides/create-a-gem/ %}).
7
7
 
8
8
  ### Plugin Template
9
9
 
data/lib/octopress-ink.rb CHANGED
@@ -27,10 +27,22 @@ module Octopress
27
27
  require 'octopress-ink/commands'
28
28
  end
29
29
 
30
+ # Register a new plugin
31
+ #
32
+ # plugin - A subclass of Plugin
33
+ #
30
34
  def self.register_plugin(plugin)
31
35
  Plugins.register_plugin(plugin)
32
36
  end
33
37
 
38
+ # Create a new plugin from a configuration hash
39
+ #
40
+ # options - A hash of configuration options.
41
+ #
42
+ def self.new_plugin(options)
43
+ Plugins.register_plugin Plugin, options
44
+ end
45
+
34
46
  def self.version
35
47
  version = "Jekyll v#{Jekyll::VERSION}, "
36
48
  if defined? Octopress::VERSION
@@ -65,14 +77,14 @@ module Octopress
65
77
 
66
78
  # Prints a list of plugins and details
67
79
  #
68
- # options - a Hash of options from the Info command
80
+ # options - a Hash of options from the `list` command
69
81
  #
70
82
  # Note: if options are empty, this will display a
71
- # list of plugin names, versions, and descriptions,
83
+ # list of plugin names, slugs, versions, and descriptions,
72
84
  # but no assets, i.e. 'minimal' info.
73
85
  #
74
86
  #
75
- def self.info(options={})
87
+ def self.list(options={})
76
88
  Plugins.register site(options)
77
89
  options = {'minimal'=>true} if options.empty?
78
90
  message = "Octopress Ink - v#{VERSION}\n"
@@ -97,9 +109,9 @@ module Octopress
97
109
  end
98
110
  end
99
111
 
100
- def self.copy_plugin_assets(name, path, options)
112
+ def self.copy_plugin_assets(name, options)
101
113
  Plugins.register site(options)
102
- if path
114
+ if path = options.delete('path')
103
115
  full_path = File.join(Plugins.site.source, path)
104
116
  if !Dir["#{full_path}/*"].empty? && options['force'].nil?
105
117
  abort "Error: directory #{path} is not empty. Use --force to overwrite files."
@@ -27,7 +27,7 @@ module Octopress
27
27
  end
28
28
 
29
29
  def url_info
30
- "path: #{page.url.sub(/^\//,'')}"
30
+ "/#{page.url.sub(/^\//,'')}"
31
31
  end
32
32
 
33
33
  def user_dir
@@ -3,6 +3,7 @@ module Octopress
3
3
  module Commands
4
4
  require 'octopress-ink/commands/list'
5
5
  require 'octopress-ink/commands/copy'
6
+ require 'octopress-ink/commands/new'
6
7
 
7
8
  class Ink < Octopress::Command
8
9
 
@@ -18,6 +19,7 @@ module Octopress
18
19
 
19
20
  List.process_command(c)
20
21
  Copy.process_command(c)
22
+ New.process_command(c)
21
23
  end
22
24
  end
23
25
  end
@@ -4,20 +4,20 @@ module Octopress
4
4
  class Copy
5
5
  def self.process_command(p)
6
6
  p.command(:copy) do |c|
7
- c.syntax "copy <PLUGIN> [PATH] [options]"
8
- c.description "Copy plugin assets to PATH (PATH defaults to _plugins/[plugin_name]/)"
9
- c.option "all", "--all", "Copy all plugin assets"
10
- c.option "force", "--force", "Overwrite files"
7
+ c.syntax "copy <PLUGIN> [options]"
8
+ c.description "Copy plugin assets to _plugins/PLUGIN/."
9
+ c.option "all", "--all", "Copy all plugin assets."
10
+ c.option "force", "--force", "Overwrite files."
11
+ c.option "path", "--path PATH", "Copy plugin assets to an alternate path."
11
12
  CommandHelpers.add_asset_options(c, 'Copy')
12
13
 
13
14
  c.action do |args, options|
14
15
  if args.empty?
15
- puts "Error: Please pass a plugin to install assets from."
16
+ puts "Error: Please pass a plugin slug to install assets from that plugin."
16
17
  Octopress::Ink.list_plugins
17
18
  else
18
19
  name = args[0]
19
- path = args[1]
20
- Octopress::Ink.copy_plugin_assets(name, path, options)
20
+ Octopress::Ink.copy_plugin_assets(name, options)
21
21
  end
22
22
  end
23
23
  end
@@ -5,14 +5,14 @@ module Octopress
5
5
  def self.process_command(p)
6
6
  p.command(:list) do |c|
7
7
  c.syntax "list [plugin] [options]"
8
- c.description "Get info about octopress ink plugins"
9
- c.option "all", "--all", "List all plugins and their assets"
8
+ c.description "Get a list of installed octopress ink plugins for this site."
9
+ c.option "all", "--all", "List all plugins and their assets."
10
10
  CommandHelpers.add_asset_options(c, 'List')
11
- c.option "docs", "--docs", "List only documentation pages"
11
+ c.option "docs", "--docs", "List only documentation pages."
12
12
 
13
13
  c.action do |args, options|
14
14
  if args.empty?
15
- Octopress::Ink.info(options)
15
+ Octopress::Ink.list(options)
16
16
  else
17
17
  name = args.first
18
18
  Octopress::Ink.plugin_info(name, options)
@@ -0,0 +1,160 @@
1
+ module Octopress
2
+ module Ink
3
+ module Commands
4
+ class New
5
+ def self.process_command(p)
6
+ p.command(:new) do |c|
7
+ c.syntax "new <PLUGIN_NAME> [options]"
8
+ c.description "Create a new Octopress Ink plugin with Ruby gem scaffolding."
9
+ c.option "path", "--path PATH", "Create a plugin at a specified path (defaults to current directory)."
10
+ c.option "theme", "--theme", "Create a new theme."
11
+
12
+ c.action do |args, options|
13
+ if args.empty?
14
+ raise "Please provide a plugin name, e.g. my_awesome_plugin."
15
+ else
16
+ options['name'] = args[0]
17
+ @options = options
18
+ new_plugin
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ def self.new_plugin
25
+ path = @options['path'] ||= Dir.pwd
26
+ gem_name = @options['name']
27
+
28
+ @gem_dir = File.join(path, gem_name)
29
+ @gemspec_file = "#{gem_name}/#{gem_name}.gemspec"
30
+
31
+ if !Dir.exist?(path)
32
+ raise "Directory not found: #{File.expand_path(path)}."
33
+ end
34
+
35
+ if !Dir["#{@gem_dir}/*"].empty?
36
+ raise "Directory not empty: #{File.expand_path(@gem_dir)}."
37
+ end
38
+
39
+ FileUtils.cd path do
40
+ create_gem
41
+ add_dependency
42
+ add_plugin
43
+ add_asset_dirs
44
+ add_demo_files
45
+ end
46
+ end
47
+
48
+ def self.create_gem
49
+ begin
50
+ require 'bundler/cli'
51
+ bundler = Bundler::CLI.new
52
+ rescue LoadError
53
+ raise "To use this feautre you'll need to install the bundler gem with `gem install bundler`."
54
+ end
55
+
56
+ bundler.gem(@options['name'])
57
+ end
58
+
59
+ # Add Octopress Ink dependency to Gemspec
60
+ #
61
+ def self.add_dependency
62
+ minor_version = VERSION.scan(/\d\.\d/)[0]
63
+ @gemspec = File.open(@gemspec_file).read
64
+ dependency = " spec.add_runtime_dependency 'octopress-ink', '~> #{minor_version}', '>= #{VERSION}'\n"
65
+ dependency += "\n spec.add_development_dependency 'octopress'\n"
66
+
67
+ pos = @gemspec.index(" spec.add_development_dependency")
68
+ @gemspec = insert_before(@gemspec, pos, dependency)
69
+
70
+ File.open(@gemspec_file, 'w+') {|f| f.write(@gemspec) }
71
+ end
72
+
73
+ # Add Octopress Ink plugin to core module file
74
+ #
75
+ def self.add_plugin
76
+ # Grab the module directory from the version.rb require.
77
+ # If a gem is created with dashes e.g. "some-gem", Bundler puts the module file at lib/some/gem.rb
78
+ module_subpath = @gemspec.scan(/['"](.+)\/version['"]/).flatten[0]
79
+ @module_file = File.join(@options['name'], 'lib', "#{module_subpath}.rb")
80
+ mod = File.open(@module_file).read
81
+
82
+ # Find the inner most module name
83
+ @modules = mod.scan(/module\s+(.+?)\n/).flatten
84
+ @mod_path = @modules.join('::')
85
+
86
+ mod = add_simple_plugin mod
87
+
88
+ File.open(@module_file, 'w+') {|f| f.write(mod) }
89
+ end
90
+
91
+ def self.add_asset_dirs
92
+ %w{images fonts pages files layouts includes stylesheets javascripts}.each do |asset|
93
+ dir = File.join(@options['name'], 'assets', asset)
94
+ FileUtils.mkdir_p dir
95
+ end
96
+ end
97
+
98
+ # New plugin uses a simple configuration hash
99
+ #
100
+ def self.add_simple_plugin(mod)
101
+ mod = mod.scan(/require.+\n/)[0]
102
+ mod += 'require "octopress-ink"'
103
+ mod += "\n\nOctopress::Ink.new_plugin({\n#{indent(plugin_config)}\n})"
104
+ end
105
+
106
+ def self.plugin_config
107
+ plugin_name = format_name(@modules.last)
108
+ plugin_slug = Filters.sluggify(@options['name'])
109
+ depth = @module_file.count('/') - 1
110
+ assets_path = ("../" * depth) + 'assets'
111
+ type = @options['theme'] ? 'theme' : 'plugin'
112
+
113
+ config = <<-HERE
114
+ name: "#{plugin_name}",
115
+ slug: "#{plugin_slug}",
116
+ assets_path: File.expand_path(File.join(File.dirname(__FILE__), "#{assets_path}")),
117
+ type: "#{type}",
118
+ version: #{@mod_path}::VERSION,
119
+ description: "",
120
+ website: ""
121
+ HERE
122
+ config.rstrip
123
+ end
124
+
125
+ def self.add_demo_files
126
+ dir = File.join(@options['name'], 'demo')
127
+ Jekyll::Commands::New.process([dir], {blank: true})
128
+
129
+ gemfile = <<-HERE
130
+ source 'https://rubygems.org'
131
+
132
+ group :octopress do
133
+ gem 'octopress'
134
+ gem '#{@options['name']}', path: '../'
135
+ end
136
+ HERE
137
+
138
+ File.open(File.join(dir, 'Gemfile'), 'w+') {|f| f.write(gemfile) }
139
+ end
140
+
141
+ def self.indent(input, level=1)
142
+ input.gsub(/^/, ' ' * level)
143
+ end
144
+ # Add spaces between capital letters
145
+ #
146
+ def self.format_name(name)
147
+ name.scan(/.*?[a-z](?=[A-Z]|$)/).join(' ')
148
+ end
149
+
150
+ def self.insert_before(str, pos, input)
151
+ if pos
152
+ str[0..(pos - 1)] + input + str[pos..-1]
153
+ else
154
+ str
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
@@ -28,10 +28,10 @@ module Octopress
28
28
  @url
29
29
  else
30
30
  begin
31
- if path_config = self.data['url_config']
32
- config = @config
33
- path_config.split('.').each { |key| config = config[key] }
34
- @url = config if config.is_a? String
31
+ config = @config['page_permalinks'][File.basename(self.name, '.*')]
32
+ if config.is_a? String
33
+ @url = config
34
+ self.data['permalink'] = nil
35
35
  end
36
36
  rescue; end
37
37
 
@@ -12,8 +12,8 @@ module Octopress
12
12
  :layouts_dir, :stylesheets_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir,
13
13
  :layouts, :includes, :images, :fonts, :files, :pages, :docs
14
14
 
15
- def initialize
16
- DEFAULT_CONFIG.merge(configuration).each { |k,v| set_config(k,v) }
15
+ def initialize(options={})
16
+ DEFAULT_CONFIG.merge(options || configuration).each { |k,v| set_config(k,v) }
17
17
 
18
18
  @layouts_dir = 'layouts'
19
19
  @files_dir = 'files'
@@ -156,35 +156,47 @@ module Octopress
156
156
 
157
157
  def info(options={})
158
158
  if options['minimal']
159
- message = " #{@name}"
160
- message += " (theme)" if @type == 'theme'
161
- message += " - v#{@version}" if @version
162
- if @description
163
- message = "#{message.ljust(30)} #{@description}"
164
- end
165
- message += "\n"
159
+ minimal_info
166
160
  else
167
- asset_info = assets_info(options)
168
- return '' if asset_info.empty?
169
-
170
- name = "Plugin: #{@name}"
171
- name += " (theme)" if @type == 'theme'
172
- name += " - v#{@version}" if @version
173
- name = name
174
- message = name
175
- message += "\nSlug: #{slug}"
176
-
177
- if @description
178
- message += "\n#{@description}"
179
- end
161
+ detailed_info(options)
162
+ end
163
+ end
164
+
165
+ def minimal_info
166
+ message = " #{@name}"
167
+ message += " (#{slug})"
168
+ message += " - v#{@version}" if @version
169
+ if @description && !@description.empty?
170
+ message = "#{message.ljust(30)} - #{@description}"
171
+ end
172
+ message += "\n"
173
+ end
180
174
 
181
- lines = ''
182
- 80.times { lines += '=' }
175
+ def detailed_info(options)
176
+ asset_info = assets_info(options)
177
+ return '' if asset_info.empty?
183
178
 
184
- message = "\n#{message}\n#{lines}\n"
185
- message += asset_info
186
- message += "\n"
179
+ name = "Plugin: #{@name}"
180
+ name += " (theme)" if @type == 'theme'
181
+ name += " - v#{@version}" if @version
182
+ name = name
183
+ message = name
184
+ message += "\nSlug: #{slug}"
185
+
186
+ if @description && !@description.empty?
187
+ message += "\n#{@description}"
187
188
  end
189
+
190
+ if @website && !@website.empty?
191
+ message += "\n#{@website}"
192
+ end
193
+
194
+ lines = ''
195
+ 80.times { lines += '=' }
196
+
197
+ message = "\n#{message}\n#{lines}\n"
198
+ message += asset_info
199
+ message += "\n"
188
200
  end
189
201
 
190
202
  def pad_line(line)
@@ -59,8 +59,8 @@ module Octopress
59
59
  @site
60
60
  end
61
61
 
62
- def self.register_plugin(plugin)
63
- new_plugin = plugin.new
62
+ def self.register_plugin(plugin, options=nil)
63
+ new_plugin = plugin.new(options)
64
64
 
65
65
  case new_plugin.type
66
66
  when 'theme'
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.alpha.43"
3
+ VERSION = "1.0.0.alpha.44"
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ ---
2
+ permalink: /four/
3
+ ---
4
+
5
+ This page is totally a thing.
@@ -1,4 +1,4 @@
1
1
  ---
2
- url_config: feed.url
2
+ permalink: /test_pages/feed/
3
3
  ---
4
4
  <tag>fooo</tag>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  layout: default
3
+ permalink: /test_pages/three.html
3
4
  ---
4
5
 
5
6
  SUB BABY
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  layout: theme:default
3
- url_config: page_urls.test
3
+ permalink_config: page_two
4
4
  ---
5
5
 
6
6
  Testing pages. **strong** *emphasized* [a link](http://example.com)
@@ -0,0 +1,5 @@
1
+ ---
2
+ permalink: /four/
3
+ ---
4
+
5
+ This page is totally a thing.
@@ -1,4 +1,4 @@
1
1
  ---
2
- url_config: feed.url
2
+ permalink: /test_pages/feed/
3
3
  ---
4
4
  <tag>fooo</tag>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  layout: default
3
+ permalink: /test_pages/three.html
3
4
  ---
4
5
 
5
6
  SUB BABY
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  layout: theme:default
3
- url_config: page_urls.test
3
+ permalink: /test_pages/theme_page.html
4
4
  ---
5
5
 
6
6
  Testing pages. **strong** *emphasized* [a link](http://example.com)
@@ -0,0 +1 @@
1
+ This page is totally a thing.
@@ -1,4 +1,4 @@
1
1
  ---
2
- url_config: page_urls.one
2
+ permalink: /cats.html
3
3
  ---
4
4
  Page one from plugin
@@ -0,0 +1,4 @@
1
+ ---
2
+ permalink: /test_pages/plugin_page.html
3
+ ---
4
+ Page two from plugin
@@ -1,15 +1,8 @@
1
1
  require 'octopress-ink'
2
2
 
3
- class TestPlugin < Octopress::Ink::Plugin
4
- def configuration
5
- {
6
- name: 'Awesome Sauce',
7
- slug: 'awesome-sauce',
8
- assets_path: File.expand_path(File.dirname(__FILE__)),
9
- description: "Test some plugins y'all"
10
- }
11
- end
12
- end
13
-
14
- Octopress::Ink.register_plugin(TestPlugin)
15
-
3
+ Octopress::Ink.new_plugin({
4
+ name: 'Awesome Sauce',
5
+ slug: 'awesome-sauce',
6
+ assets_path: File.expand_path(File.dirname(__FILE__)),
7
+ description: "Test some plugins y'all"
8
+ })
@@ -1,5 +1,2 @@
1
1
  test: config from theme
2
2
  test_override: also config from theme
3
- page_urls:
4
- sub: /test-pages/sub/test.html
5
- test: /test-pages/index.html
@@ -0,0 +1,5 @@
1
+ ---
2
+ permalink: /four/
3
+ ---
4
+
5
+ This page is totally a thing.
@@ -0,0 +1,4 @@
1
+ ---
2
+ permalink: /test_pages/feed/
3
+ ---
4
+ <tag>fooo</tag>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  layout: default
3
+ permalink: /test_pages/three.html
3
4
  ---
4
5
 
5
6
  SUB BABY
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  layout: theme:default
3
- url_config: page_urls.test
4
3
  ---
5
4
 
6
5
  Testing pages. **strong** *emphasized* [a link](http://example.com)
@@ -1,14 +1,8 @@
1
1
  require 'octopress-ink'
2
2
 
3
- class TestTheme < Octopress::Ink::Plugin
4
- def configuration
5
- {
6
- type: "theme",
7
- description: "Test theme y'all",
8
- name: "Classic Theme",
9
- assets_path: File.expand_path(File.dirname(__FILE__))
10
- }
11
- end
12
- end
13
-
14
- Octopress::Ink.register_plugin(TestTheme)
3
+ Octopress::Ink.new_plugin({
4
+ name: "Classic Theme",
5
+ type: "theme",
6
+ description: "Test theme y'all",
7
+ assets_path: File.expand_path(File.dirname(__FILE__))
8
+ })
@@ -1,4 +1,4 @@
1
- /* Theme: classic */
1
+ /* Theme: Classic Theme */
2
2
  body { margin: 2px; padding: 2px; }
3
3
 
4
4
  .main { color: #444; }
@@ -8,7 +8,7 @@ body { background: black; }
8
8
  /* Plugin: awesome-sauce */
9
9
  .plugin-widget { background: red; color: #fff; }
10
10
 
11
- /* Plugin: asset-pipeline */
11
+ /* Plugin: Octopress Asset Pipeline */
12
12
  .css-plugin { background: #fed; }
13
13
 
14
14
  body { display: table; }
@@ -1,3 +1,5 @@
1
+ /* Theme: Classic Theme */
1
2
  * { background: none; color: #000; }
2
3
 
4
+ /* Plugin: Awesome Sauce */
3
5
  article a:after { content: attr(href); }
@@ -1,4 +1,4 @@
1
- /* Theme: classic */
1
+ /* Theme: Classic Theme */
2
2
  body {
3
3
  margin: 2px;
4
4
  padding: 2px;
@@ -18,7 +18,7 @@ body {
18
18
  color: #fff;
19
19
  }
20
20
 
21
- /* Plugin: asset-pipeline */
21
+ /* Plugin: Octopress Asset Pipeline */
22
22
  .css-plugin {
23
23
  background: #fed;
24
24
  }
@@ -1,8 +1,10 @@
1
+ /* Theme: Classic Theme */
1
2
  * {
2
3
  background: none;
3
4
  color: #000;
4
5
  }
5
6
 
7
+ /* Plugin: Awesome Sauce */
6
8
  article a:after {
7
9
  content: attr(href);
8
10
  }
@@ -1,8 +1,4 @@
1
1
  test_override: config from plugin override
2
- page_urls:
3
- one: test_pages/plugin_page_override.html
4
- two: test_pages/plugin_page.html
5
-
6
- #disable:
7
- #pages: test_pages/one.html
8
- #includes: true
2
+ page_permalinks:
3
+ a: test_pages/plugin_page_override.html
4
+ b: test_pages/plugin_page.html
@@ -1,8 +1,7 @@
1
1
  test_override: config from theme override
2
- page_urls:
3
- test: test_pages/theme_page.html
4
- feed:
5
- url: test_pages/feed/
2
+ page_permalinks:
3
+ two: test_pages/theme_page.html
4
+ feed: test_pages/feed/
6
5
 
7
6
  disable:
8
7
  fonts: true
data/test/test.rb CHANGED
@@ -166,22 +166,22 @@ test_javascripts('concat_js')
166
166
  test_configs('expected')
167
167
  test_root_assets('expected')
168
168
 
169
- Octopress::Ink.copy_plugin_assets('theme', '_copy', {'force'=> true})
169
+ Octopress::Ink.copy_plugin_assets('theme', {'path' => '_copy', 'force'=> true})
170
170
  test_copy_assets('copy_test')
171
171
 
172
- Octopress::Ink.copy_plugin_assets('theme', '_copy', {'force'=> true, 'layouts' => true, 'pages' => true})
172
+ Octopress::Ink.copy_plugin_assets('theme', {'path' => '_copy', 'force'=> true, 'layouts' => true, 'pages' => true})
173
173
  test_copy_assets('copy_layouts_pages')
174
174
 
175
175
  build octopress_config: '_concat_false.yml'
176
176
  test_stylesheets('concat_css_false', false)
177
177
  test_javascripts('concat_js_false', false)
178
- #test_disabled('site')
178
+ test_disabled('site')
179
179
 
180
- #build config: '_sass_compact.yml'
181
- #test_stylesheets('sass_compact')
180
+ build config: '_sass_compact.yml'
181
+ test_stylesheets('sass_compact')
182
182
 
183
- #build config: '_sass_expanded.yml'
184
- #test_stylesheets('sass_expanded')
183
+ build config: '_sass_expanded.yml'
184
+ test_stylesheets('sass_expanded')
185
185
 
186
186
  print_failures
187
187
 
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.alpha.43
4
+ version: 1.0.0.alpha.44
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-03-25 00:00:00.000000000 Z
11
+ date: 2014-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -116,7 +116,6 @@ files:
116
116
  - Rakefile
117
117
  - assets/docs/_configuration.markdown
118
118
  - assets/docs/_plugin-template.markdown
119
- - assets/docs/creating-a-gem.markdown
120
119
  - assets/docs/creating-a-plugin.markdown
121
120
  - assets/docs/index.markdown
122
121
  - assets/docs/plugin-reference.markdown
@@ -139,6 +138,7 @@ files:
139
138
  - lib/octopress-ink/commands/copy.rb
140
139
  - lib/octopress-ink/commands/helpers.rb
141
140
  - lib/octopress-ink/commands/list.rb
141
+ - lib/octopress-ink/commands/new.rb
142
142
  - lib/octopress-ink/configuration.rb
143
143
  - lib/octopress-ink/filters.rb
144
144
  - lib/octopress-ink/generators/plugin_assets.rb
@@ -194,6 +194,7 @@ files:
194
194
  - test/copy_layouts_pages/_copy/layouts/default.html
195
195
  - test/copy_layouts_pages/_copy/layouts/test.html
196
196
  - test/copy_layouts_pages/_copy/pages/disable-test.html
197
+ - test/copy_layouts_pages/_copy/pages/four.xml
197
198
  - test/copy_layouts_pages/_copy/pages/one.xml
198
199
  - test/copy_layouts_pages/_copy/pages/three.md
199
200
  - test/copy_layouts_pages/_copy/pages/two.md
@@ -210,6 +211,7 @@ files:
210
211
  - test/copy_test/_copy/layouts/default.html
211
212
  - test/copy_test/_copy/layouts/test.html
212
213
  - test/copy_test/_copy/pages/disable-test.html
214
+ - test/copy_test/_copy/pages/four.xml
213
215
  - test/copy_test/_copy/pages/one.xml
214
216
  - test/copy_test/_copy/pages/three.md
215
217
  - test/copy_test/_copy/pages/two.md
@@ -222,6 +224,7 @@ files:
222
224
  - test/expected/2014/02/01/test-post.html
223
225
  - test/expected/favicon.ico
224
226
  - test/expected/favicon.png
227
+ - test/expected/four/index.xml
225
228
  - test/expected/index.html
226
229
  - test/expected/robots.txt
227
230
  - test/expected/test_config/plugin_config.html
@@ -248,8 +251,8 @@ files:
248
251
  - test/plugins/awesome-sauce/files/robots.txt
249
252
  - test/plugins/awesome-sauce/includes/some-include.html
250
253
  - test/plugins/awesome-sauce/layouts/test-layout.html
251
- - test/plugins/awesome-sauce/pages/test_pages/one.html
252
- - test/plugins/awesome-sauce/pages/test_pages/two.html
254
+ - test/plugins/awesome-sauce/pages/a.html
255
+ - test/plugins/awesome-sauce/pages/b.html
253
256
  - test/plugins/awesome-sauce/plugin.rb
254
257
  - test/plugins/awesome-sauce/stylesheets/plugin-media-test@print.css
255
258
  - test/plugins/awesome-sauce/stylesheets/plugin-test.css
@@ -268,10 +271,10 @@ files:
268
271
  - test/plugins/test-theme/layouts/default.html
269
272
  - test/plugins/test-theme/layouts/test.html
270
273
  - test/plugins/test-theme/pages/disable-test.html
271
- - test/plugins/test-theme/pages/test_pages/disable-test.html
272
- - test/plugins/test-theme/pages/test_pages/one.xml
273
- - test/plugins/test-theme/pages/test_pages/three.md
274
- - test/plugins/test-theme/pages/test_pages/two.md
274
+ - test/plugins/test-theme/pages/four.xml
275
+ - test/plugins/test-theme/pages/one.xml
276
+ - test/plugins/test-theme/pages/three.md
277
+ - test/plugins/test-theme/pages/two.md
275
278
  - test/plugins/test-theme/plugin.rb
276
279
  - test/plugins/test-theme/stylesheets/_colors.scss
277
280
  - test/plugins/test-theme/stylesheets/disable-this.css
@@ -371,6 +374,7 @@ test_files:
371
374
  - test/copy_layouts_pages/_copy/layouts/default.html
372
375
  - test/copy_layouts_pages/_copy/layouts/test.html
373
376
  - test/copy_layouts_pages/_copy/pages/disable-test.html
377
+ - test/copy_layouts_pages/_copy/pages/four.xml
374
378
  - test/copy_layouts_pages/_copy/pages/one.xml
375
379
  - test/copy_layouts_pages/_copy/pages/three.md
376
380
  - test/copy_layouts_pages/_copy/pages/two.md
@@ -387,6 +391,7 @@ test_files:
387
391
  - test/copy_test/_copy/layouts/default.html
388
392
  - test/copy_test/_copy/layouts/test.html
389
393
  - test/copy_test/_copy/pages/disable-test.html
394
+ - test/copy_test/_copy/pages/four.xml
390
395
  - test/copy_test/_copy/pages/one.xml
391
396
  - test/copy_test/_copy/pages/three.md
392
397
  - test/copy_test/_copy/pages/two.md
@@ -399,6 +404,7 @@ test_files:
399
404
  - test/expected/2014/02/01/test-post.html
400
405
  - test/expected/favicon.ico
401
406
  - test/expected/favicon.png
407
+ - test/expected/four/index.xml
402
408
  - test/expected/index.html
403
409
  - test/expected/robots.txt
404
410
  - test/expected/test_config/plugin_config.html
@@ -425,8 +431,8 @@ test_files:
425
431
  - test/plugins/awesome-sauce/files/robots.txt
426
432
  - test/plugins/awesome-sauce/includes/some-include.html
427
433
  - test/plugins/awesome-sauce/layouts/test-layout.html
428
- - test/plugins/awesome-sauce/pages/test_pages/one.html
429
- - test/plugins/awesome-sauce/pages/test_pages/two.html
434
+ - test/plugins/awesome-sauce/pages/a.html
435
+ - test/plugins/awesome-sauce/pages/b.html
430
436
  - test/plugins/awesome-sauce/plugin.rb
431
437
  - test/plugins/awesome-sauce/stylesheets/plugin-media-test@print.css
432
438
  - test/plugins/awesome-sauce/stylesheets/plugin-test.css
@@ -445,10 +451,10 @@ test_files:
445
451
  - test/plugins/test-theme/layouts/default.html
446
452
  - test/plugins/test-theme/layouts/test.html
447
453
  - test/plugins/test-theme/pages/disable-test.html
448
- - test/plugins/test-theme/pages/test_pages/disable-test.html
449
- - test/plugins/test-theme/pages/test_pages/one.xml
450
- - test/plugins/test-theme/pages/test_pages/three.md
451
- - test/plugins/test-theme/pages/test_pages/two.md
454
+ - test/plugins/test-theme/pages/four.xml
455
+ - test/plugins/test-theme/pages/one.xml
456
+ - test/plugins/test-theme/pages/three.md
457
+ - test/plugins/test-theme/pages/two.md
452
458
  - test/plugins/test-theme/plugin.rb
453
459
  - test/plugins/test-theme/stylesheets/_colors.scss
454
460
  - test/plugins/test-theme/stylesheets/disable-this.css
@@ -1,69 +0,0 @@
1
- ---
2
- title: "Creating a Gem"
3
- permalink: /guides/creating-a-gem/
4
- ---
5
-
6
- *This guide assumes you have already installed Git, and Ruby 1.9.3 or greater.*
7
-
8
- Octopress Ink plugins are distributed as ruby gems so you'll probably need to create an acconut at [RubyGems.org](https://rubygems.org/sign_up) if you haven't yet. Also, be sure you have [bundler](http://bundler.io) installed.
9
-
10
- ### How to Create a Gem
11
-
12
- The [bundler gem](http://bundler.io/) is a great way to manage gems and provides some terrific utilites for gem creators. Go ahead and
13
- install it if you haven't yet.
14
-
15
- ```sh
16
- gem install bundler
17
- ```
18
-
19
- Now we'll use Bundler to create a gem project for our new plugin.
20
-
21
- ```sh
22
- bundle gem baconnaise
23
- ```
24
-
25
- That's right, this plugin will be called `baconnaise`. That command will generate a bunch of files into the new `baconnaise` directory. Take a peek inside and you'll see somethig like this:
26
-
27
- ```
28
- lib/
29
- baconnaise/
30
- version.rb
31
- baconnaise.rb
32
- baconnaise.gemspec
33
- Gemfile
34
- LICENSE.txt
35
- Rakefile
36
- README.md
37
- ```
38
-
39
- First, you'll want to edit your `baconnaise.gemspec` to be sure the information in that is right. Be sure to change the default description and summary. The gem won't build if you have a *TODO* in either of those. Here's what we're gonig to go with.
40
-
41
- ```ruby
42
- spec.description = %q{Baconnaise, because mistakes have never been this spreadable.}
43
- spec.summary = %q{Baconnaise, because #YOLO.}
44
- ```
45
-
46
- Next you'll want to add Octopress Ink as a runtime dependency. Here's what that looks like.
47
-
48
- ```ruby
49
- spec.add_runtime_dependency 'octopress-ink', '~> 1.0'
50
- ```
51
-
52
- #### A note on Version Numbering
53
-
54
- By default the `bundle gem` command starts you off at version `0.0.1`. If you take a look at `lib/baconnaise/version.rb` you'll see this.
55
-
56
- ```
57
- module Baconnaise
58
- VERSION = "0.0.1"
59
- end
60
- ```
61
-
62
- I'd encourage you to change your version number to `1.0.0` as soon as you release your plugin for production use. For a sensible guide on version numbers, refer to [semver.org](http://semver.org/).
63
-
64
- ---
65
-
66
- For the next part we'll take a look at creating an Octopress Ink plugin.
67
-
68
- [Creating a Plugin &rarr;]({% doc_url /guides/creating-a-plugin/ %})
69
-
@@ -1,4 +0,0 @@
1
- ---
2
- url_config: page_urls.two
3
- ---
4
- Page two from plugin
@@ -1,3 +0,0 @@
1
- ---
2
- ---
3
- This page shouldn't appear
@@ -1,4 +0,0 @@
1
- ---
2
- url_config: feed.url
3
- ---
4
- <tag>fooo</tag>