awestruct 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/awestruct/extensions/sitemap.rb +18 -1
- data/lib/awestruct/extensions/sitemap.xml.haml +2 -2
- data/lib/awestruct/version.rb +1 -1
- metadata +213 -178
@@ -41,12 +41,29 @@ module Awestruct
|
|
41
41
|
protected
|
42
42
|
def set_sitemap_data( page )
|
43
43
|
site = page.site
|
44
|
-
page
|
44
|
+
munge_date( page )
|
45
45
|
page.priority ||= (site.priority or 0.1)
|
46
46
|
page.change_frequency ||= (site.change_frequency or 'never')
|
47
47
|
page
|
48
48
|
end
|
49
49
|
|
50
|
+
def munge_date( page )
|
51
|
+
date = page.date
|
52
|
+
if date
|
53
|
+
begin
|
54
|
+
if date.kind_of? String
|
55
|
+
page.lastmod = Time.parse( page.date ).strftime( "%Y-%m-%d" )
|
56
|
+
else
|
57
|
+
page.lastmod = date.strftime( "%Y-%m-%d" )
|
58
|
+
end
|
59
|
+
rescue Exception => e
|
60
|
+
puts "[ERROR] Cannot parse date #{date.to_s}: #{e}"
|
61
|
+
end
|
62
|
+
else
|
63
|
+
page.lastmod = Time.now.strftime( "%Y-%m-%d" )
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
50
67
|
def valid_sitemap_entry( page )
|
51
68
|
page.output_filename != '.htaccess' &&
|
52
69
|
page.output_filename != 'screen.css' &&
|
@@ -7,8 +7,8 @@
|
|
7
7
|
- for entry in page.sitemap_entries
|
8
8
|
%url
|
9
9
|
%loc= "#{entry.site.base_url}#{entry.url}"
|
10
|
-
- if entry.
|
11
|
-
%lastmod= entry.
|
10
|
+
- if entry.lastmod
|
11
|
+
%lastmod= entry.lastmod
|
12
12
|
- if entry.priority
|
13
13
|
%priority= entry.priority
|
14
14
|
- if entry.change_frequency
|
data/lib/awestruct/version.rb
CHANGED
metadata
CHANGED
@@ -1,189 +1,222 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awestruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 10
|
9
|
+
version: 0.2.10
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
|
-
|
12
|
+
- Bob McWhirter
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-11-17 00:00:00
|
17
|
+
date: 2011-11-17 00:00:00 -05:00
|
18
|
+
default_executable:
|
14
19
|
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: hpricot
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: haml
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - <=
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 3
|
41
|
+
- 1
|
42
|
+
- 0
|
43
|
+
version: 3.1.0
|
44
|
+
type: :runtime
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sass
|
48
|
+
prerelease: false
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - <=
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 3
|
55
|
+
- 1
|
56
|
+
- 0
|
57
|
+
version: 3.1.0
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id003
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: hashery
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 1
|
69
|
+
- 4
|
70
|
+
- 0
|
71
|
+
version: 1.4.0
|
72
|
+
type: :runtime
|
73
|
+
version_requirements: *id004
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: rdiscount
|
76
|
+
prerelease: false
|
77
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 1
|
83
|
+
- 6
|
84
|
+
- 8
|
85
|
+
version: 1.6.8
|
86
|
+
type: :runtime
|
87
|
+
version_requirements: *id005
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: RedCloth
|
90
|
+
prerelease: false
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - <=
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
segments:
|
96
|
+
- 4
|
97
|
+
- 2
|
98
|
+
- 5
|
99
|
+
version: 4.2.5
|
100
|
+
type: :runtime
|
101
|
+
version_requirements: *id006
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: compass
|
104
|
+
prerelease: false
|
105
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
- 11
|
112
|
+
- 5
|
113
|
+
version: 0.11.5
|
114
|
+
type: :runtime
|
115
|
+
version_requirements: *id007
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: compass-960-plugin
|
118
|
+
prerelease: false
|
119
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - <=
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
- 10
|
126
|
+
- 4
|
127
|
+
version: 0.10.4
|
128
|
+
type: :runtime
|
129
|
+
version_requirements: *id008
|
130
|
+
- !ruby/object:Gem::Dependency
|
131
|
+
name: org-ruby
|
132
|
+
prerelease: false
|
133
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
- 5
|
140
|
+
- 3
|
141
|
+
version: 0.5.3
|
142
|
+
type: :runtime
|
143
|
+
version_requirements: *id009
|
144
|
+
- !ruby/object:Gem::Dependency
|
145
|
+
name: fssm
|
146
|
+
prerelease: false
|
147
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
segments:
|
152
|
+
- 0
|
153
|
+
- 2
|
154
|
+
- 7
|
155
|
+
version: 0.2.7
|
156
|
+
type: :runtime
|
157
|
+
version_requirements: *id010
|
125
158
|
description:
|
126
159
|
email: bob@mcwhirter.org
|
127
160
|
executables:
|
128
|
-
|
161
|
+
- awestruct
|
129
162
|
extensions: []
|
130
163
|
|
131
164
|
extra_rdoc_files: []
|
132
165
|
|
133
166
|
files:
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
167
|
+
- lib/awestruct/commands/deploy.rb
|
168
|
+
- lib/awestruct/commands/frameworks/base_pipeline.rb
|
169
|
+
- lib/awestruct/commands/generate.rb
|
170
|
+
- lib/awestruct/commands/init.rb
|
171
|
+
- lib/awestruct/commands/manifest.rb
|
172
|
+
- lib/awestruct/commands/server.rb
|
173
|
+
- lib/awestruct/config.rb
|
174
|
+
- lib/awestruct/context_helper.rb
|
175
|
+
- lib/awestruct/engine.rb
|
176
|
+
- lib/awestruct/erb_file.rb
|
177
|
+
- lib/awestruct/erbable.rb
|
178
|
+
- lib/awestruct/extensions/atomizer.rb
|
179
|
+
- lib/awestruct/extensions/data_dir.rb
|
180
|
+
- lib/awestruct/extensions/disqus.rb
|
181
|
+
- lib/awestruct/extensions/flattr.rb
|
182
|
+
- lib/awestruct/extensions/google_analytics.rb
|
183
|
+
- lib/awestruct/extensions/gsub.rb
|
184
|
+
- lib/awestruct/extensions/indexifier.rb
|
185
|
+
- lib/awestruct/extensions/intense_debate.rb
|
186
|
+
- lib/awestruct/extensions/paginator.rb
|
187
|
+
- lib/awestruct/extensions/partial.rb
|
188
|
+
- lib/awestruct/extensions/pipeline.rb
|
189
|
+
- lib/awestruct/extensions/posts.rb
|
190
|
+
- lib/awestruct/extensions/sitemap.rb
|
191
|
+
- lib/awestruct/extensions/tag_cloud.rb
|
192
|
+
- lib/awestruct/extensions/tagger.rb
|
193
|
+
- lib/awestruct/front_matter_file.rb
|
194
|
+
- lib/awestruct/haml_file.rb
|
195
|
+
- lib/awestruct/hamlable.rb
|
196
|
+
- lib/awestruct/markdown_file.rb
|
197
|
+
- lib/awestruct/markdownable.rb
|
198
|
+
- lib/awestruct/org_mode_file.rb
|
199
|
+
- lib/awestruct/org_modeable.rb
|
200
|
+
- lib/awestruct/renderable.rb
|
201
|
+
- lib/awestruct/renderable_file.rb
|
202
|
+
- lib/awestruct/sass_file.rb
|
203
|
+
- lib/awestruct/sassable.rb
|
204
|
+
- lib/awestruct/scss_file.rb
|
205
|
+
- lib/awestruct/site.rb
|
206
|
+
- lib/awestruct/textilable.rb
|
207
|
+
- lib/awestruct/textile_file.rb
|
208
|
+
- lib/awestruct/util/default_inflections.rb
|
209
|
+
- lib/awestruct/util/inflector.rb
|
210
|
+
- lib/awestruct/verbatim_file.rb
|
211
|
+
- lib/awestruct/version.rb
|
212
|
+
- lib/awestruct.rb
|
213
|
+
- lib/awestruct/commands/frameworks/960/base_layout.html.haml
|
214
|
+
- lib/awestruct/commands/frameworks/base_index.html.haml
|
215
|
+
- lib/awestruct/commands/frameworks/blueprint/base_layout.html.haml
|
216
|
+
- lib/awestruct/extensions/sitemap.xml.haml
|
217
|
+
- lib/awestruct/extensions/tag_cloud.html.haml
|
218
|
+
- lib/awestruct/extensions/template.atom.haml
|
219
|
+
has_rdoc: true
|
187
220
|
homepage:
|
188
221
|
licenses: []
|
189
222
|
|
@@ -191,23 +224,25 @@ post_install_message:
|
|
191
224
|
rdoc_options: []
|
192
225
|
|
193
226
|
require_paths:
|
194
|
-
|
227
|
+
- lib
|
195
228
|
required_ruby_version: !ruby/object:Gem::Requirement
|
196
|
-
none: false
|
197
229
|
requirements:
|
198
|
-
|
199
|
-
|
200
|
-
|
230
|
+
- - ">="
|
231
|
+
- !ruby/object:Gem::Version
|
232
|
+
segments:
|
233
|
+
- 0
|
234
|
+
version: "0"
|
201
235
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
|
-
none: false
|
203
236
|
requirements:
|
204
|
-
|
205
|
-
|
206
|
-
|
237
|
+
- - ">="
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
segments:
|
240
|
+
- 0
|
241
|
+
version: "0"
|
207
242
|
requirements: []
|
208
243
|
|
209
244
|
rubyforge_project:
|
210
|
-
rubygems_version: 1.
|
245
|
+
rubygems_version: 1.3.6
|
211
246
|
signing_key:
|
212
247
|
specification_version: 3
|
213
248
|
summary: Static site-baking utility
|