octopress-ink 1.0.0.rc.43 → 1.0.0.rc.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/octopress-ink.rb +1 -0
- data/lib/octopress-ink/assets.rb +1 -0
- data/lib/octopress-ink/assets/template.rb +45 -0
- data/lib/octopress-ink/commands/new.rb +1 -1
- data/lib/octopress-ink/jekyll/hooks.rb +4 -0
- data/lib/octopress-ink/jekyll/template_page.rb +14 -0
- data/lib/octopress-ink/plugin.rb +28 -2
- data/lib/octopress-ink/plugins.rb +9 -7
- data/lib/octopress-ink/version.rb +1 -1
- 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: 6f406acf8134296326633da8071b2b065bde2448
|
4
|
+
data.tar.gz: 27eb1c1ff48eeb84c929e584b71aa65f86d6ab73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 655308cfcd46f93a85e04e8f1a53ec6cd5577118b52a206ed032cdaaa79b99eb4b1ae29159022a8f62ecb8de8d9fb447f4226ae29f7f0232f65338c3edf08107
|
7
|
+
data.tar.gz: c84f0c5dcc53def4bb5cd6f2d1b03615bd810792259bc6fc51bf3b525ff18235a51ba29b1e8c2df0f5b70b70995aa19b49b147ca3f990fab46b4ad3eb59e8907
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.0.0 RC44 - 2015-02-18
|
4
|
+
- Fix: Plugins reset for each build, fixing builds with Jekyll's watch enabled.
|
5
|
+
- New: Added plugin templates for dynamically generating pages.
|
6
|
+
|
3
7
|
### 1.0.0 RC43 - 2015-02-16
|
4
8
|
- Fix: Multilingual configurations are deep merged with primary language config to allow for less unnecessary duplication.
|
5
9
|
|
data/lib/octopress-ink.rb
CHANGED
@@ -20,6 +20,7 @@ module Octopress
|
|
20
20
|
autoload :Assets, 'octopress-ink/assets'
|
21
21
|
autoload :Convertible, 'octopress-ink/jekyll/convertible'
|
22
22
|
autoload :Page, 'octopress-ink/jekyll/page'
|
23
|
+
autoload :TemplatePage, 'octopress-ink/jekyll/template_page'
|
23
24
|
autoload :Layout, 'octopress-ink/jekyll/layout'
|
24
25
|
autoload :StaticFile, 'octopress-ink/jekyll/static_file'
|
25
26
|
autoload :StaticFileContent, 'octopress-ink/jekyll/static_file_content'
|
data/lib/octopress-ink/assets.rb
CHANGED
@@ -6,6 +6,7 @@ module Octopress
|
|
6
6
|
autoload :LangConfig, 'octopress-ink/assets/lang_config'
|
7
7
|
autoload :FileAsset, 'octopress-ink/assets/file'
|
8
8
|
autoload :PageAsset, 'octopress-ink/assets/page'
|
9
|
+
autoload :Template, 'octopress-ink/assets/template'
|
9
10
|
autoload :Javascript, 'octopress-ink/assets/javascript'
|
10
11
|
autoload :Coffeescript, 'octopress-ink/assets/coffeescript'
|
11
12
|
autoload :Stylesheet, 'octopress-ink/assets/stylesheet'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Ink
|
3
|
+
module Assets
|
4
|
+
class Template < Asset
|
5
|
+
attr_accessor :pages
|
6
|
+
|
7
|
+
def add; end
|
8
|
+
|
9
|
+
def info
|
10
|
+
message = filename.ljust(35)
|
11
|
+
if disabled?
|
12
|
+
message += "-disabled-"
|
13
|
+
elsif path.to_s != plugin_path
|
14
|
+
shortpath = File.join(Plugins.custom_dir.sub(Dir.pwd,''), dir).sub('/','')
|
15
|
+
message += "from: #{shortpath}/#{filename}"
|
16
|
+
end
|
17
|
+
message = " #{message}\n"
|
18
|
+
self.pages.each do |page|
|
19
|
+
message << " - #{page.path.sub('index.html', '')}\n"
|
20
|
+
end
|
21
|
+
message
|
22
|
+
end
|
23
|
+
|
24
|
+
def new_page(permalink, data={})
|
25
|
+
@pages ||= []
|
26
|
+
return if disabled?
|
27
|
+
|
28
|
+
dir = File.dirname(permalink)
|
29
|
+
name = File.basename(permalink)
|
30
|
+
|
31
|
+
page = Ink::TemplatePage.new(Octopress.site, File.dirname(self.path), '.', File.basename(self.path))
|
32
|
+
|
33
|
+
page.data.merge!(data)
|
34
|
+
|
35
|
+
page.dir = dir
|
36
|
+
page.name = name
|
37
|
+
page.process(name)
|
38
|
+
|
39
|
+
page
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -151,7 +151,7 @@ _site
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def self.add_assets
|
154
|
-
dirs = %w{docs images fonts pages files layouts includes stylesheets javascripts}.map do |asset|
|
154
|
+
dirs = %w{docs images fonts pages templates files layouts includes stylesheets javascripts}.map do |asset|
|
155
155
|
File.join(@settings[:path], 'assets', asset)
|
156
156
|
end
|
157
157
|
create_empty_dirs dirs
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Ink
|
3
|
+
class TemplatePage < Jekyll::Page
|
4
|
+
attr_accessor :dir, :name
|
5
|
+
include Ink::Convertible
|
6
|
+
|
7
|
+
def relative_asset_path
|
8
|
+
site_source = Pathname.new Octopress.site.source
|
9
|
+
page_source = Pathname.new @base
|
10
|
+
page_source.relative_path_from(site_source).to_s
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/octopress-ink/plugin.rb
CHANGED
@@ -9,8 +9,8 @@ module Octopress
|
|
9
9
|
}
|
10
10
|
|
11
11
|
attr_reader :name, :type, :path, :assets_path, :local, :website, :description, :gem, :version, :source_url, :website,
|
12
|
-
:layouts_dir, :stylesheets_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir,
|
13
|
-
:layouts, :includes, :images, :fonts, :files, :pages, :docs
|
12
|
+
:layouts_dir, :stylesheets_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir, :templates_dir,
|
13
|
+
:layouts, :includes, :images, :fonts, :files, :pages, :templates, :docs
|
14
14
|
|
15
15
|
def initialize(options)
|
16
16
|
options = Jekyll::Utils.symbolize_hash_keys(options || configuration)
|
@@ -26,6 +26,7 @@ module Octopress
|
|
26
26
|
@includes_dir = 'includes'
|
27
27
|
@javascripts_dir = 'javascripts'
|
28
28
|
@stylesheets_dir = 'stylesheets'
|
29
|
+
@templates_dir = 'templates'
|
29
30
|
@lang_configs = []
|
30
31
|
@layouts = []
|
31
32
|
@includes = []
|
@@ -38,6 +39,7 @@ module Octopress
|
|
38
39
|
@fonts = []
|
39
40
|
@files = []
|
40
41
|
@pages = []
|
42
|
+
@templates = []
|
41
43
|
@slug ||= @name
|
42
44
|
@assets_path ||= File.join(@path, 'assets')
|
43
45
|
end
|
@@ -59,6 +61,7 @@ module Octopress
|
|
59
61
|
add_fonts
|
60
62
|
add_files
|
61
63
|
add_pages
|
64
|
+
add_templates
|
62
65
|
add_stylesheets
|
63
66
|
end
|
64
67
|
end
|
@@ -89,8 +92,14 @@ module Octopress
|
|
89
92
|
next if name == 'config-file'
|
90
93
|
assets.each {|file| file.add unless file.disabled? }
|
91
94
|
end
|
95
|
+
|
96
|
+
add_template_pages
|
92
97
|
end
|
93
98
|
|
99
|
+
# Plugin authors override with template page adding
|
100
|
+
#
|
101
|
+
def add_template_pages; end
|
102
|
+
|
94
103
|
# Copy asset files to plugin override path
|
95
104
|
#
|
96
105
|
def copy_asset_files(path, options)
|
@@ -237,6 +246,7 @@ module Octopress
|
|
237
246
|
def can_disable
|
238
247
|
[
|
239
248
|
'pages',
|
249
|
+
'templates',
|
240
250
|
'sass',
|
241
251
|
'css',
|
242
252
|
'stylesheets',
|
@@ -253,6 +263,7 @@ module Octopress
|
|
253
263
|
{
|
254
264
|
'layouts' => @layouts,
|
255
265
|
'includes' => @includes,
|
266
|
+
'templates' => @templates,
|
256
267
|
'pages' => @pages,
|
257
268
|
'sass' => @sass,
|
258
269
|
'css' => @css,
|
@@ -432,6 +443,21 @@ module Octopress
|
|
432
443
|
@pages = add_new_assets(@pages_dir, Assets::PageAsset)
|
433
444
|
end
|
434
445
|
|
446
|
+
def add_templates
|
447
|
+
@templates = add_new_assets(@templates_dir, Assets::Template)
|
448
|
+
end
|
449
|
+
|
450
|
+
def add_template_page(template, permalink, data={})
|
451
|
+
template = @templates.find { |t| t.filename == template }
|
452
|
+
|
453
|
+
unless template.nil? || template.disabled?
|
454
|
+
page = template.new_page(permalink, data)
|
455
|
+
template.pages << page
|
456
|
+
Octopress.site.pages << page
|
457
|
+
page
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
435
461
|
def add_docs
|
436
462
|
Octopress::Docs.add_plugin_docs(self)
|
437
463
|
end
|
@@ -3,13 +3,6 @@ module Octopress
|
|
3
3
|
module Plugins
|
4
4
|
extend self
|
5
5
|
|
6
|
-
@static_files = []
|
7
|
-
@plugins = []
|
8
|
-
@user_plugins = []
|
9
|
-
@css_tags = []
|
10
|
-
@js_tags = []
|
11
|
-
@registered = false
|
12
|
-
|
13
6
|
def theme
|
14
7
|
@theme
|
15
8
|
end
|
@@ -44,6 +37,15 @@ module Octopress
|
|
44
37
|
[@theme].concat(@plugins).concat(@user_plugins).compact
|
45
38
|
end
|
46
39
|
|
40
|
+
def reset
|
41
|
+
@static_files = []
|
42
|
+
@plugins = []
|
43
|
+
@user_plugins = []
|
44
|
+
@css_tags = []
|
45
|
+
@js_tags = []
|
46
|
+
@registered = false
|
47
|
+
end
|
48
|
+
|
47
49
|
def register
|
48
50
|
unless @registered
|
49
51
|
@registered = true
|
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.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: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/octopress-ink/assets/page.rb
|
193
193
|
- lib/octopress-ink/assets/sass.rb
|
194
194
|
- lib/octopress-ink/assets/stylesheet.rb
|
195
|
+
- lib/octopress-ink/assets/template.rb
|
195
196
|
- lib/octopress-ink/cache.rb
|
196
197
|
- lib/octopress-ink/commands.rb
|
197
198
|
- lib/octopress-ink/commands/copy.rb
|
@@ -206,6 +207,7 @@ files:
|
|
206
207
|
- lib/octopress-ink/jekyll/page.rb
|
207
208
|
- lib/octopress-ink/jekyll/static_file.rb
|
208
209
|
- lib/octopress-ink/jekyll/static_file_content.rb
|
210
|
+
- lib/octopress-ink/jekyll/template_page.rb
|
209
211
|
- lib/octopress-ink/plugin.rb
|
210
212
|
- lib/octopress-ink/plugin_asset_pipeline.rb
|
211
213
|
- lib/octopress-ink/plugins.rb
|