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 +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/octopress-ink/commands/new.rb +5 -2
- data/lib/octopress-ink/jekyll/hooks.rb +39 -22
- 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: 95b695c1790cd0bba8f1cc1fc0c0d53d30fdaaca
|
4
|
+
data.tar.gz: 24f76e2a0450a822bc59194e6e88b4fa363b3e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e478581c5b16475d982fdf4c219b75970b670fc3a4eb1975978006b2f672f1dc977b6131ef95bc33cecfbe65276ffd17bb98598a7a1983a281a24060fb9036
|
7
|
+
data.tar.gz: 08c3aa98a5078ae00aff10a85ed008515506379be8f409f14ae29022f1736d04ea80babc90f8a989170b95c08c977d7354d7d9b59a4a4ac75efbf9d2317740b1
|
data/CHANGELOG.md
CHANGED
@@ -98,8 +98,11 @@ module Octopress
|
|
98
98
|
end
|
99
99
|
create_empty_dirs dirs
|
100
100
|
|
101
|
-
# Add
|
102
|
-
|
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
|
-
|
11
|
-
|
12
|
-
payload['page'] = add_post_vars(page)
|
13
|
-
end
|
11
|
+
do_layout_orig(payload, layouts)
|
12
|
+
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
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(
|
24
|
-
linkpost =
|
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!(
|
50
|
+
Octopress::Utils.titlecase!(data['title'])
|
34
51
|
end
|
35
52
|
|
36
|
-
|
37
|
-
'title_text' => title_text(config,
|
38
|
-
'title_html' => title_html(config,
|
39
|
-
'title_url' => linkpost ||
|
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(
|
45
|
-
"<time class='entry-date' datetime='#{
|
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}
|
123
|
+
"#{marker} #{title}"
|
107
124
|
else
|
108
|
-
"#{title}
|
125
|
+
"#{title} #{marker}"
|
109
126
|
end
|
110
127
|
end
|
111
128
|
|
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.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-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|