middleman-blog-drafts 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -6,6 +6,12 @@ module Middleman
|
|
6
6
|
# methods on {Blog::Drafts::Data} (accessible through BlogData#drafts).
|
7
7
|
# @see http://rdoc.info/github/middleman/middleman/Middleman/Sitemap/Resource Middleman::Sitemap::Resource
|
8
8
|
module DraftArticle
|
9
|
+
# The title of the draft article, or "(UNTITLED DRAFT)" if no title was provided
|
10
|
+
# @return [String]
|
11
|
+
def title
|
12
|
+
data["title"] || "(UNTITLED DRAFT)"
|
13
|
+
end
|
14
|
+
|
9
15
|
# The "slug" of the draft article that shows up in its URL.
|
10
16
|
# @return [String]
|
11
17
|
def slug
|
@@ -16,7 +22,8 @@ module Middleman
|
|
16
22
|
# @param [String] The part of the path, e.g. "title"
|
17
23
|
# @return [String]
|
18
24
|
def path_part(part)
|
19
|
-
|
25
|
+
normalized_path = Addressable::URI.parse(path).normalize.to_s
|
26
|
+
@_path_parts ||= blog_data.drafts.source_template.extract(normalized_path)
|
20
27
|
@_path_parts[part.to_s]
|
21
28
|
end
|
22
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-blog-drafts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: middleman-core
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- fixtures/drafts-app/config.rb
|
72
72
|
- fixtures/drafts-app/source/drafts/draft-build-false.html.erb
|
73
73
|
- fixtures/drafts-app/source/drafts/draft-build-true.html.erb
|
74
|
+
- fixtures/drafts-app/source/drafts/draft-without-title.html.erb
|
74
75
|
- fixtures/drafts-app/source/drafts/listing_drafts.html.erb
|
75
76
|
- fixtures/drafts-app/source/drafts/new-draft.html.erb
|
76
77
|
- fixtures/drafts-app/source/drafts/other-draft.html.erb
|
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
114
|
version: '0'
|
114
115
|
segments:
|
115
116
|
- 0
|
116
|
-
hash:
|
117
|
+
hash: -1904865189572897641
|
117
118
|
requirements: []
|
118
119
|
rubyforge_project:
|
119
120
|
rubygems_version: 1.8.25
|
@@ -131,6 +132,7 @@ test_files:
|
|
131
132
|
- fixtures/drafts-app/config.rb
|
132
133
|
- fixtures/drafts-app/source/drafts/draft-build-false.html.erb
|
133
134
|
- fixtures/drafts-app/source/drafts/draft-build-true.html.erb
|
135
|
+
- fixtures/drafts-app/source/drafts/draft-without-title.html.erb
|
134
136
|
- fixtures/drafts-app/source/drafts/listing_drafts.html.erb
|
135
137
|
- fixtures/drafts-app/source/drafts/new-draft.html.erb
|
136
138
|
- fixtures/drafts-app/source/drafts/other-draft.html.erb
|