octopress-ink 1.0.0.rc.1 → 1.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7aaa5bcf89c2f4ee26fe475db4657f9abadf369
4
- data.tar.gz: 500a1709b5f6561e18231ea43ac3a69c0c671f59
3
+ metadata.gz: 95b695c1790cd0bba8f1cc1fc0c0d53d30fdaaca
4
+ data.tar.gz: 24f76e2a0450a822bc59194e6e88b4fa363b3e4b
5
5
  SHA512:
6
- metadata.gz: e71e8686034c36d30d288e8be98cdcee95eee9b762ac946a1dbb5679627216ddcf8626a3f6ff175fcb5df78dc120318c2e3dd02c6f0d285d7a8920e18cf92933
7
- data.tar.gz: b4135e91764ec41e747e8b514ea22dfa92408045ee35c2c5bc5df8c12f4fbaaa93471707a499628f8443318fccd47670abaf0c76827a43c6828803352cfdbd02
6
+ metadata.gz: b9e478581c5b16475d982fdf4c219b75970b670fc3a4eb1975978006b2f672f1dc977b6131ef95bc33cecfbe65276ffd17bb98598a7a1983a281a24060fb9036
7
+ data.tar.gz: 08c3aa98a5078ae00aff10a85ed008515506379be8f409f14ae29022f1736d04ea80babc90f8a989170b95c08c977d7354d7d9b59a4a4ac75efbf9d2317740b1
data/CHANGELOG.md CHANGED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## Current released version
4
+ ### 1.0.0 RC2 - 2014-05-26
5
+
6
+ - Fixed: Post and Page data is appended to at read time.
7
+
8
+ ## Past versions
9
+
10
+ ### 1.0.0 RC1 - 2014-05-25
11
+
12
+ - Initial release candidate
@@ -98,8 +98,11 @@ module Octopress
98
98
  end
99
99
  create_empty_dirs dirs
100
100
 
101
- # Add empty configuration file
102
- FileUtils.touch File.join(@settings[:path], 'assets', 'config.yml')
101
+ # Add Jekyll configuration file
102
+ #
103
+ config = "exclude:\n - Gemfile*\ngems:\n - #{@settings[:name]}"
104
+ path = File.join(@settings[:path], 'assets', 'config.yml')
105
+ write(path, config)
103
106
  end
104
107
 
105
108
  # New plugin uses a simple configuration hash
@@ -1,27 +1,44 @@
1
1
  module Jekyll
2
2
  module Convertible
3
3
  alias_method :do_layout_orig, :do_layout
4
+ alias_method :read_yaml_orig, :read_yaml
4
5
 
5
6
  def do_layout(payload, layouts)
6
7
  # The contentblock tags needs access to the converter to process it while rendering.
7
8
  payload = Octopress::Ink.payload(payload)
8
9
  payload['converter'] = self.converter
9
10
 
10
- if page = payload['page']
11
- if type == :post
12
- payload['page'] = add_post_vars(page)
13
- end
11
+ do_layout_orig(payload, layouts)
12
+ end
14
13
 
15
- if page['date']
16
- payload['page']['date_html'] = date_html(page['date'])
17
- end
14
+ def read_yaml(base, name, opts = {})
15
+ read_yaml_orig(base, name, opts)
16
+
17
+ if type == :post
18
+ self.data.merge! add_post_vars(self.data)
18
19
  end
19
20
 
20
- do_layout_orig(payload, layouts)
21
+ if self.data['date']
22
+ text = format_date(self.data['date'])
23
+ xmlschema = datetime(self.data['date']).xmlschema
24
+ html = date_html(text, xmlschema)
25
+
26
+ self.data['date_xml'] = xmlschema
27
+ self.data['date_html'] = html
28
+ end
29
+
30
+ if self.data['updated']
31
+ text = format_date(self.data['updated'])
32
+ xmlschema = datetime(self.data['updated']).xmlschema
33
+ html = date_html(text, xmlschema)
34
+
35
+ self.data['updated_date_xml'] = xmlschema
36
+ self.data['updated_date_html'] = html
37
+ end
21
38
  end
22
39
 
23
- def add_post_vars(page)
24
- linkpost = page['external-url']
40
+ def add_post_vars(data)
41
+ linkpost = data['external-url']
25
42
 
26
43
  if linkpost
27
44
  config = Octopress::Ink.config['linkpost']
@@ -30,19 +47,19 @@ module Jekyll
30
47
  end
31
48
 
32
49
  if Octopress::Ink.config['titlecase']
33
- Octopress::Utils.titlecase!(page['title'])
50
+ Octopress::Utils.titlecase!(data['title'])
34
51
  end
35
52
 
36
- page.merge({
37
- 'title_text' => title_text(config, page['title']),
38
- 'title_html' => title_html(config, page['title']),
39
- 'title_url' => linkpost || page['url'],
53
+ {
54
+ 'title_text' => title_text(config, data['title']),
55
+ 'title_html' => title_html(config, data['title']),
56
+ 'title_url' => linkpost || self.url,
40
57
  'linkpost' => !linkpost.nil?
41
- })
58
+ }
42
59
  end
43
60
 
44
- def date_html(date)
45
- "<time class='entry-date' datetime='#{ datetime(date).xmlschema }' pubdate>#{ format_date(date) }</time>"
61
+ def date_html(text, xmlschema)
62
+ "<time class='entry-date' datetime='#{ xmlschema }' pubdate>#{ text }</time>"
46
63
  end
47
64
 
48
65
  def format_date(date)
@@ -95,17 +112,17 @@ module Jekyll
95
112
 
96
113
 
97
114
  def title_html(config, title)
115
+ title = Octopress::Ink::Filters.unorphan(title)
116
+
98
117
  return title if !config['marker']
99
118
 
100
119
  marker = "<span class='post-marker post-marker-#{config['marker_position']}'>#{config['marker']}</span>"
101
120
  position = config['marker_position']
102
121
 
103
- title = Octopress::Ink::Filters.unorphan(title)
104
-
105
122
  if config['marker_position'] == 'before'
106
- "#{marker} #{title}"
123
+ "#{marker}&nbsp;#{title}"
107
124
  else
108
- "#{title} #{marker}"
125
+ "#{title}&nbsp;#{marker}"
109
126
  end
110
127
  end
111
128
 
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.1"
3
+ VERSION = "1.0.0.rc.2"
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.1
4
+ version: 1.0.0.rc.2
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-05-25 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll