octopress-ink 1.0.0.rc.40 → 1.0.0.rc.41

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a89f28e51ee7ad62be2b3b82f3eab970633d96e6
4
- data.tar.gz: addb76d7efda7eaa527508d1ecc122d4fa2dbcd3
3
+ metadata.gz: ae4c767603111477b17cc1a114faa2b21f496f5b
4
+ data.tar.gz: 1270563568f44529d5ae82c59acd1678d6877f0d
5
5
  SHA512:
6
- metadata.gz: 0c27542401b8df9a907e1f45f0c2d209b3418771f694aec430d68bfa79c0897d39ca61f9070602538ddc4fee05ffb80ed95e1c5b1252a002bf65a8ab366ca886
7
- data.tar.gz: c67e1a389461818bdf350b0541dbfc6b8f7abdbf455acf099ee665756b8ee3724f2786b63e568c12d462fa4c37605a10109191db3559b0677f99249344edf885
6
+ metadata.gz: fa63a50bfbdfcca6225ec32528d2adae7803bc6746be374bb82f5bc8ad62ee9d5f96c290520d526a1481a5ddcfcd60cff1c1f723392978cf75300ff6adcd8d2a
7
+ data.tar.gz: 6aad860f4d89d61c12de9ab41e679377b58ab93aca49b9590326009e25951c64d36dfdc56ff9f16c3b362291f0dd79db4d34c2f86de90e8bdbffd1132d7d6ee7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 RC41 - 2015-02-13
4
+ - Fix: Properly copies pages without permalinks.
5
+ - Permalink configurations now allow directories and file extensions in config keys.
6
+
3
7
  ### 1.0.0 RC40 - 2015-02-08
4
8
  - Improvements to ink list command output.
5
9
  - Ensures plugins cannot be registered multiple times.
@@ -100,7 +100,7 @@ module Octopress
100
100
  end
101
101
 
102
102
  def destination
103
- File.join(dir, file)
103
+ File.join(base, plugin.slug, file)
104
104
  end
105
105
 
106
106
  def content
@@ -3,7 +3,7 @@ module Octopress
3
3
  module Assets
4
4
  class Coffeescript < Javascript
5
5
  def tag
6
- "<script src='#{Filters.expand_url(File.join(dir, file.sub(/\.coffee$/,'.js')))}'></script>"
6
+ "<script src='#{Filters.expand_url(File.join(dir, File.basename(file, '.*') << '.js'))}'></script>"
7
7
  end
8
8
 
9
9
  def add
@@ -16,7 +16,7 @@ module Octopress
16
16
  end
17
17
 
18
18
  def destination
19
- File.join(base, plugin.slug, file.sub(/\.coffee/,'.js'))
19
+ File.join(base, plugin.slug, File.basename(file, '.*') << '.js')
20
20
  end
21
21
  end
22
22
  end
@@ -33,8 +33,26 @@ module Octopress
33
33
  config = Jekyll::Utils.deep_merge_hashes(config, user_config)
34
34
  end
35
35
 
36
+ fix_permalinks(config)
37
+ end
38
+
39
+ # Permalinks should not contain file extensions
40
+ # This replaces file extensions in the keys so they
41
+ # still work
42
+ #
43
+ def fix_permalinks(config)
44
+ fixed_permalinks = {}
36
45
  config['permalinks'] ||= {}
37
46
 
47
+ config['permalinks'].each do |k,v|
48
+ if k.match('.')
49
+ key = k.sub(File.extname(k), '')
50
+ fixed_permalinks[key] = v
51
+ config['permalinks'].delete(k)
52
+ end
53
+ end
54
+
55
+ config['permalinks'] = fixed_permalinks
38
56
  config
39
57
  end
40
58
  end
@@ -23,6 +23,10 @@ module Octopress
23
23
  end
24
24
  end
25
25
 
26
+ def destination
27
+ File.join(dir, file)
28
+ end
29
+
26
30
  private
27
31
 
28
32
  def filename
@@ -16,7 +16,7 @@ module Octopress
16
16
  @dir = File.dirname(file)
17
17
  @file = File.basename(file)
18
18
  @exists = {}
19
- @permalink_name = File.basename(file, '.*')
19
+ @permalink_name = file.sub(File.extname(file), '')
20
20
  @data = {}
21
21
  file_check
22
22
  end
@@ -27,18 +27,22 @@ module Octopress
27
27
  if page.url && !find_page(page)
28
28
  Octopress.site.pages << page
29
29
  plugin.config['permalinks'] ||= {}
30
- plugin.config['permalinks'][File.basename(filename, '.*')] ||= page.url
30
+ plugin.config['permalinks'][@permalink_name] ||= page.url
31
31
  end
32
32
  end
33
33
 
34
- def clone(permalink_name, permalink, data={})
34
+ def clone(permalink, permalink_name=nil)
35
35
  p = PageAsset.new(plugin, base, file)
36
36
  p.permalink_name = permalink_name
37
37
  p.permalink ||= permalink
38
- p.data.merge!(data)
39
38
  p
40
39
  end
41
40
 
41
+ def merge_data(data={})
42
+ self.data.merge!(data)
43
+ self
44
+ end
45
+
42
46
  def find_page(page)
43
47
  site_dir = Octopress.site.dest
44
48
  dest = page.destination(site_dir)
@@ -50,7 +54,7 @@ module Octopress
50
54
  end
51
55
 
52
56
  def page
53
- @page ||= begin
57
+ @page ||= begin
54
58
  page = Page.new(Octopress.site, source_dir, page_dir, file, self)
55
59
  page.data.merge!(@data)
56
60
  page
@@ -69,7 +73,10 @@ module Octopress
69
73
  end
70
74
 
71
75
  def permalink=(url)
72
- @permalink = plugin.config['permalinks'][permalink_name] = url
76
+ @permalink = url
77
+ if permalink_name
78
+ plugin.config['permalinks'][permalink_name] = url
79
+ end
73
80
  end
74
81
 
75
82
  private
@@ -79,7 +79,7 @@ module Octopress
79
79
  end
80
80
 
81
81
  def output_file_name
82
- file.sub(/@/,'-').sub(/s.ss/, 'css')
82
+ File.basename(file.sub('@','-'), '.*') << '.css'
83
83
  end
84
84
  end
85
85
  end
@@ -42,7 +42,7 @@ module Octopress
42
42
  end
43
43
 
44
44
  def output_file_name
45
- file.sub(/@/,'-')
45
+ file.sub('@','-')
46
46
  end
47
47
  end
48
48
  end
@@ -35,19 +35,19 @@ module Octopress
35
35
  def url
36
36
  @url ||= begin
37
37
  @asset.permalink ||= self.data['permalink']
38
- url = @asset.permalink
38
+ @url = @asset.permalink
39
39
 
40
40
  super
41
41
 
42
- if url && url =~ /\/$/
42
+ if @url && @url =~ /\/$/
43
43
  if self.ext == '.xml'
44
- url = File.join(url, "index.xml")
44
+ @url = File.join(url, "index.xml")
45
45
  else
46
- url = File.join(url, "index.html")
46
+ @url = File.join(url, "index.html")
47
47
  end
48
48
  end
49
49
 
50
- url
50
+ @url
51
51
  end
52
52
  end
53
53
  end
@@ -192,6 +192,10 @@ module Octopress
192
192
  Pathname.new(@includes.find{|i| i.filename == file }.path)
193
193
  end
194
194
 
195
+ def find_page(path)
196
+ @pages.find {|page| page.filename == path }
197
+ end
198
+
195
199
  private
196
200
 
197
201
  def get_paths(files)
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.40"
3
+ VERSION = "1.0.0.rc.41"
4
4
  end
5
5
  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.40
4
+ version: 1.0.0.rc.41
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-08 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll