octopress-ink 1.0.0.rc.36 → 1.0.0.rc.37
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 +6 -0
- data/lib/octopress-ink/assets/page.rb +26 -7
- data/lib/octopress-ink/jekyll/page.rb +9 -25
- data/lib/octopress-ink/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccdb4e645dc51a1054578a2ada97f281d9c18002
|
4
|
+
data.tar.gz: f6fc232afa388a80fa9c2f1cdbf172612cfb23a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e3b71f0016778d02bec195b12d42adc34ef755b02ddfdf60d1fa342f40167afd85f968fa1d01494431753576ec053f42f9a830bf5dfe8b21865d9f9d646d945
|
7
|
+
data.tar.gz: 4292efba16ea66b024518ae8648592cd31e8bf7e216f6903ced458ff1923e7d3e60f221cdd1ef260f02ece145f1aadc46bbf429e546ab29fc1ed97cc3fdf73b6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.0.0 RC37 - 2015-01-31
|
4
|
+
|
5
|
+
- Added `clone` method to page assets.
|
6
|
+
- Pages now list permalink settings in `ink list` view.
|
7
|
+
- Refactored page permalink system.
|
8
|
+
|
3
9
|
### 1.0.0 RC36 - 2015-01-31
|
4
10
|
|
5
11
|
- Fix: Octopress Hooks now fire properly on page assets.
|
@@ -6,6 +6,7 @@ module Octopress
|
|
6
6
|
module Assets
|
7
7
|
class PageAsset < Asset
|
8
8
|
attr_reader :filename
|
9
|
+
attr_accessor :data, :permalink_name
|
9
10
|
|
10
11
|
def initialize(plugin, base, file)
|
11
12
|
@root = plugin.assets_path
|
@@ -15,6 +16,8 @@ module Octopress
|
|
15
16
|
@dir = File.dirname(file)
|
16
17
|
@file = File.basename(file)
|
17
18
|
@exists = {}
|
19
|
+
@permalink_name = File.basename(file, '.*')
|
20
|
+
@data = {}
|
18
21
|
file_check
|
19
22
|
end
|
20
23
|
|
@@ -28,6 +31,14 @@ module Octopress
|
|
28
31
|
end
|
29
32
|
end
|
30
33
|
|
34
|
+
def clone(permalink_name, permalink, data={})
|
35
|
+
p = PageAsset.new(plugin, base, file)
|
36
|
+
p.permalink_name = permalink_name
|
37
|
+
p.permalink ||= permalink
|
38
|
+
p.data.merge!(data)
|
39
|
+
p
|
40
|
+
end
|
41
|
+
|
31
42
|
def find_page(page)
|
32
43
|
site_dir = Octopress.site.dest
|
33
44
|
dest = page.destination(site_dir)
|
@@ -39,12 +50,25 @@ module Octopress
|
|
39
50
|
end
|
40
51
|
|
41
52
|
def page
|
42
|
-
@page ||=
|
53
|
+
@page ||= begin
|
54
|
+
page = Page.new(Octopress.site, source_dir, page_dir, file, self)
|
55
|
+
page.data.merge!(@data)
|
56
|
+
page
|
57
|
+
end
|
43
58
|
end
|
44
59
|
|
45
60
|
def info
|
46
61
|
message = super
|
47
|
-
message.ljust(
|
62
|
+
message.sub!(/#{filename}/, permalink_name.ljust(filename.size))
|
63
|
+
message.ljust(25) + page.permalink
|
64
|
+
end
|
65
|
+
|
66
|
+
def permalink
|
67
|
+
@permalink ||= plugin.config['permalinks'][permalink_name]
|
68
|
+
end
|
69
|
+
|
70
|
+
def permalink=(url)
|
71
|
+
@permalink = plugin.config['permalinks'][permalink_name] = url
|
48
72
|
end
|
49
73
|
|
50
74
|
private
|
@@ -57,10 +81,6 @@ module Octopress
|
|
57
81
|
File.join(plugin_dir, dir, file)
|
58
82
|
end
|
59
83
|
|
60
|
-
def url_info
|
61
|
-
"/#{page.url.sub(/^\//,'')}"
|
62
|
-
end
|
63
|
-
|
64
84
|
def user_dir
|
65
85
|
File.join Octopress.site.source, Plugins.custom_dir, plugin.slug, base
|
66
86
|
end
|
@@ -69,4 +89,3 @@ module Octopress
|
|
69
89
|
end
|
70
90
|
end
|
71
91
|
end
|
72
|
-
|
@@ -10,17 +10,13 @@ module Octopress
|
|
10
10
|
# - '/' for the _site/index.html page
|
11
11
|
# - '/archive/' for the _site/archive/index.html page
|
12
12
|
#
|
13
|
-
def initialize(site, base, dir, name,
|
14
|
-
@
|
13
|
+
def initialize(site, base, dir, name, asset)
|
14
|
+
@asset = asset
|
15
15
|
super(site, base, dir, name)
|
16
|
-
post_init if respond_to?(:post_init)
|
17
16
|
end
|
18
17
|
|
19
18
|
def destination(dest)
|
20
19
|
unless @dest
|
21
|
-
if @config['path']
|
22
|
-
dest = File.join(dest, @config['path'])
|
23
|
-
end
|
24
20
|
@dest = File.join(dest, self.url)
|
25
21
|
end
|
26
22
|
@dest
|
@@ -35,33 +31,21 @@ module Octopress
|
|
35
31
|
# Allow pages to read url from plugin configuration
|
36
32
|
#
|
37
33
|
def url
|
38
|
-
|
39
|
-
@
|
40
|
-
|
41
|
-
begin
|
42
|
-
|
43
|
-
page_name = File.basename(self.name, '.*')
|
44
|
-
config = @config['permalinks'][page_name]
|
45
|
-
|
46
|
-
if config.is_a? String
|
47
|
-
@url = config
|
48
|
-
self.data['permalink'] = nil
|
49
|
-
else
|
50
|
-
@config['permalinks'][File.basename(self.name, '.*')] = self.data['permalink']
|
51
|
-
end
|
52
|
-
rescue; end
|
34
|
+
@url ||= begin
|
35
|
+
@asset.permalink ||= self.data['permalink']
|
36
|
+
url = @asset.permalink
|
53
37
|
|
54
38
|
super
|
55
39
|
|
56
|
-
if
|
40
|
+
if url && url =~ /\/$/
|
57
41
|
if self.ext == '.xml'
|
58
|
-
|
42
|
+
url = File.join(url, "index.xml")
|
59
43
|
else
|
60
|
-
|
44
|
+
url = File.join(url, "index.html")
|
61
45
|
end
|
62
46
|
end
|
63
47
|
|
64
|
-
|
48
|
+
url
|
65
49
|
end
|
66
50
|
end
|
67
51
|
end
|
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.37
|
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-01
|
11
|
+
date: 2015-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|