website_builder_engine 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,13 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h2. 0.0.4 September 29, 2011
4
+
5
+ * generate sitemap.xml after any article is published
6
+ * fix permalink on welcome page for Facebook metadata
7
+ * rename 'introdution' to 'about' on welcome page
8
+ * change Facebook 'recommend' link location on articles pages
9
+ * reduce H1 tags to just one on a page
10
+
3
11
  h2. 0.0.3 September 25, 2011
4
12
 
5
13
  * improve Facebook OpenGraph metadata for templates
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'rails', '3.1.1.rc1'
3
+ gem 'rails', '3.1.0'
4
4
  group :assets do
5
5
  gem 'sass-rails', " ~> 3.1.0"
6
6
  gem 'coffee-rails', "~> 3.1.0"
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- website_builder_engine (0.0.3)
10
+ website_builder_engine (0.0.4)
11
11
  RedCloth
12
12
  bourbon
13
13
  bson_ext
@@ -20,12 +20,12 @@ GEM
20
20
  remote: http://rubygems.org/
21
21
  specs:
22
22
  RedCloth (4.2.8)
23
- actionmailer (3.1.1.rc1)
24
- actionpack (= 3.1.1.rc1)
23
+ actionmailer (3.1.0)
24
+ actionpack (= 3.1.0)
25
25
  mail (~> 2.3.0)
26
- actionpack (3.1.1.rc1)
27
- activemodel (= 3.1.1.rc1)
28
- activesupport (= 3.1.1.rc1)
26
+ actionpack (3.1.0)
27
+ activemodel (= 3.1.0)
28
+ activesupport (= 3.1.0)
29
29
  builder (~> 3.0.0)
30
30
  erubis (~> 2.7.0)
31
31
  i18n (~> 0.6)
@@ -34,21 +34,23 @@ GEM
34
34
  rack-mount (~> 0.8.2)
35
35
  rack-test (~> 0.6.1)
36
36
  sprockets (~> 2.0.0)
37
- activemodel (3.1.1.rc1)
38
- activesupport (= 3.1.1.rc1)
37
+ activemodel (3.1.0)
38
+ activesupport (= 3.1.0)
39
+ bcrypt-ruby (~> 3.0.0)
39
40
  builder (~> 3.0.0)
40
41
  i18n (~> 0.6)
41
- activerecord (3.1.1.rc1)
42
- activemodel (= 3.1.1.rc1)
43
- activesupport (= 3.1.1.rc1)
42
+ activerecord (3.1.0)
43
+ activemodel (= 3.1.0)
44
+ activesupport (= 3.1.0)
44
45
  arel (~> 2.2.1)
45
46
  tzinfo (~> 0.3.29)
46
- activeresource (3.1.1.rc1)
47
- activemodel (= 3.1.1.rc1)
48
- activesupport (= 3.1.1.rc1)
49
- activesupport (3.1.1.rc1)
47
+ activeresource (3.1.0)
48
+ activemodel (= 3.1.0)
49
+ activesupport (= 3.1.0)
50
+ activesupport (3.1.0)
50
51
  multi_json (~> 1.0)
51
52
  arel (2.2.1)
53
+ bcrypt-ruby (3.0.1)
52
54
  bourbon (0.1.9)
53
55
  sass (>= 3.1)
54
56
  bson (1.4.0)
@@ -103,17 +105,17 @@ GEM
103
105
  rack
104
106
  rack-test (0.6.1)
105
107
  rack (>= 1.0)
106
- rails (3.1.1.rc1)
107
- actionmailer (= 3.1.1.rc1)
108
- actionpack (= 3.1.1.rc1)
109
- activerecord (= 3.1.1.rc1)
110
- activeresource (= 3.1.1.rc1)
111
- activesupport (= 3.1.1.rc1)
108
+ rails (3.1.0)
109
+ actionmailer (= 3.1.0)
110
+ actionpack (= 3.1.0)
111
+ activerecord (= 3.1.0)
112
+ activeresource (= 3.1.0)
113
+ activesupport (= 3.1.0)
112
114
  bundler (~> 1.0)
113
- railties (= 3.1.1.rc1)
114
- railties (3.1.1.rc1)
115
- actionpack (= 3.1.1.rc1)
116
- activesupport (= 3.1.1.rc1)
115
+ railties (= 3.1.0)
116
+ railties (3.1.0)
117
+ actionpack (= 3.1.0)
118
+ activesupport (= 3.1.0)
117
119
  rack-ssl (~> 1.3.2)
118
120
  rake (>= 0.8.7)
119
121
  rdoc (~> 3.4)
@@ -129,7 +131,7 @@ GEM
129
131
  diff-lcs (~> 1.1.2)
130
132
  rspec-mocks (2.6.0)
131
133
  sass (3.1.7)
132
- sass-rails (3.1.2)
134
+ sass-rails (3.1.3)
133
135
  actionpack (~> 3.1.0)
134
136
  railties (~> 3.1.0)
135
137
  sass (>= 3.1.4)
@@ -163,7 +165,7 @@ DEPENDENCIES
163
165
  html2textile!
164
166
  jquery-rails
165
167
  mongoid (>= 2.2.1)
166
- rails (= 3.1.1.rc1)
168
+ rails (= 3.1.0)
167
169
  rspec (~> 2.6)
168
170
  sass-rails (~> 3.1.0)
169
171
  uglifier (>= 1.0.3)
@@ -56,7 +56,7 @@ body.articles {
56
56
  font-family: inherit;
57
57
  color: inherit;
58
58
  }
59
- h1 {
59
+ h2 {
60
60
  color: #444;
61
61
  border-bottom: 1px solid #ccc;
62
62
  font-size: 14px;
@@ -8,6 +8,7 @@ body.welcome {
8
8
  color: #555;
9
9
 
10
10
  .logo {
11
+ h1 {font-size: inherit;font: inherit;}
11
12
  margin-top:30px;
12
13
  margin-bottom:0px;
13
14
  .sitename{float:left;text-transform: lowercase;}
@@ -56,7 +57,7 @@ body.welcome {
56
57
  font-family: inherit;
57
58
  color: inherit;
58
59
  }
59
- h1 {
60
+ h2 {
60
61
  color: #444;
61
62
  border-bottom: 1px solid #ccc;
62
63
  font-size: 14px;
@@ -23,9 +23,14 @@ module WebsiteBuilderEngine
23
23
  # create (or recreate) the welcome page
24
24
  @articles = Article.where(published: true)
25
25
  @welcome_sidebar = RedCloth.new(@settings.sidebar).to_html.html_safe if @settings.sidebar
26
- @welcome_intro = RedCloth.new(@settings.introduction).to_html.html_safe if @settings.introduction
26
+ @welcome_intro = RedCloth.new(@settings.about).to_html.html_safe if @settings.about
27
27
  welcome_page = render_to_string(:template => "website_builder_engine/welcome/template.html.haml", :layout => false )
28
28
  File.open("#{@docroot_path}index.html", 'w') {|f| f.write(welcome_page) }
29
+ # create a sitemap.xml page
30
+ @offerpages = Offerpage.all
31
+ sitemap_page = render_to_string(:template => "website_builder_engine/templates/sitemap.xml.haml", :layout => false )
32
+ File.open("#{@docroot_path}sitemap.xml", 'w') {|f| f.write(sitemap_page) }
33
+ # display list of articles when done
29
34
  respond_to do |format|
30
35
  format.html { redirect_to articles_path, notice: "Built a webpage for the article \"#{@article.title}\"" }
31
36
  end
@@ -1,5 +1,6 @@
1
1
  class Article
2
2
  include Mongoid::Document
3
+ include Mongoid::Timestamps
3
4
  field :title, :type => String
4
5
  field :filename, :type => String
5
6
  field :description, :type => String
@@ -1,5 +1,6 @@
1
1
  class Offerpage
2
2
  include Mongoid::Document
3
+ include Mongoid::Timestamps
3
4
  field :title, :type => String
4
5
  field :filename, :type => String
5
6
  field :description, :type => String
@@ -10,7 +10,7 @@ class Setting
10
10
  field :articles_directory, :type => String
11
11
  field :offerpages_directory, :type => String
12
12
  field :sidebar, :type => String
13
- field :introduction, :type => String
13
+ field :about, :type => String
14
14
  field :google_analytics_id, :type => String
15
15
  field :twitter_account, :type => String
16
16
  field :facebook_admin_id, :type => String
@@ -10,6 +10,9 @@
10
10
  %p
11
11
  %b Keywords:
12
12
  = @article.keywords
13
+ %p
14
+ %b Article image URL:
15
+ = @article.keywords
13
16
  %p
14
17
  %b Headline:
15
18
  = @article.headline
@@ -33,6 +33,8 @@
33
33
  = @settings.site_tagline
34
34
  %hr/
35
35
  %article.twelve.columns
36
+ #fb-root
37
+ %fb:like{:action => "recommend", :send => "true", :show_faces => "false", :width => "450"}
36
38
  %header
37
39
  %hgroup
38
40
  %h1
@@ -40,11 +42,9 @@
40
42
  %h2
41
43
  = @article.subhead
42
44
  = @content
43
- #fb-root
44
- %fb:like{:action => "recommend", :send => "true", :show_faces => "false", :width => "450"}
45
45
  %aside.four.columns
46
46
  %section
47
- %h1
47
+ %h2
48
48
  Recommend This Article
49
49
  %ul
50
50
  %li
@@ -53,7 +53,7 @@
53
53
  %a.twitter-share-button{"data-count" => "none",
54
54
  "data-via" => "#{@settings.twitter_account}", :href => "http://twitter.com/share"}
55
55
  %section
56
- %h1
56
+ %h2
57
57
  Related Articles
58
58
  %ul
59
59
  - if @related_items.empty?
@@ -37,8 +37,8 @@
37
37
  = f.label :sidebar
38
38
  = f.text_area :sidebar
39
39
  .field
40
- = f.label :introduction
41
- = f.text_area :introduction
40
+ = f.label :about
41
+ = f.text_area :about
42
42
  .field
43
43
  = f.label :google_analytics_id
44
44
  = f.text_field :google_analytics_id
@@ -16,19 +16,31 @@
16
16
  %p
17
17
  %b Site keywords:
18
18
  = @setting.site_keywords
19
+ %p
20
+ %b Site image URL:
21
+ = @setting.site_image_url
19
22
  %p
20
23
  %b Articles directory:
21
24
  = @setting.articles_directory
22
25
  %p
23
26
  %b Offer Pages directory:
24
27
  = @setting.offerpages_directory
28
+ %p
29
+ %b Google Analytics ID:
30
+ = @setting.twitter_account
25
31
  %p
26
32
  %b Twitter account:
27
33
  = @setting.twitter_account
34
+ %p
35
+ %b Facebook admin ID:
36
+ = @setting.twitter_account
28
37
  %p
29
38
  %b Article sidebar:
30
39
  = @setting.sidebar
31
-
40
+ %p
41
+ %b About the Website:
42
+ = @setting.about
43
+
32
44
  = link_to 'Edit', edit_setting_path(@setting)
33
45
  \|
34
46
  = link_to 'Back', settings_path
@@ -0,0 +1,22 @@
1
+ - def w3c_date(date) date.utc.strftime("%Y-%m-%dT%H:%M:%S+00:00") end
2
+ !!! XML
3
+ %urlset{:xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9"}
4
+ %url
5
+ %loc= "http://#{@settings.domain}/index.html"
6
+ %lastmod= w3c_date Time.now
7
+ %changefreq daily
8
+ %priority 1.0
9
+ - unless @articles.empty?
10
+ - for article in @articles
11
+ %url
12
+ %loc= "http://#{@settings.domain}/#{@settings.articles_directory}/#{article.filename}.html"
13
+ %lastmod= w3c_date article.updated_at
14
+ %changefreq daily
15
+ %priority 0.5
16
+ - unless @offerpages.empty?
17
+ - for offerpage in @offerpages
18
+ %url
19
+ %loc= "http://#{@settings.domain}/#{@settings.offerpages_directory}/#{offerpage.filename}.html"
20
+ %lastmod= w3c_date offerpage.updated_at
21
+ %changefreq daily
22
+ %priority 0.5
@@ -7,7 +7,7 @@
7
7
  %meta{:name=>'keywords', :content=>"#{@settings.site_keywords}"}
8
8
  -# meta tags for the Open Graph protocol for Facebook
9
9
  %meta{:property => "og:type", :content => "website"}
10
- %meta{:property => "og:url", :content => "#{@permalink}"}
10
+ %meta{:property => "og:url", :content => "http://#{@settings.domain}/index.html"}
11
11
  - unless @settings.site_title.blank?
12
12
  %meta{:property => "og:title", :content => "#{@settings.site_title}"}
13
13
  - unless @settings.site_image_url.blank?
@@ -37,7 +37,7 @@
37
37
  #fb-root
38
38
  %fb:like{:action => "recommend", :send => "true", :show_faces => "false", :width => "450"}
39
39
  - unless @welcome_intro.blank?
40
- %h2 Introduction
40
+ %h2 About the Website
41
41
  = @welcome_intro
42
42
  - unless @articles.empty?
43
43
  %h2 Articles
@@ -47,7 +47,7 @@
47
47
  = link_to article.title, "#{@url_path + article.filename}.html"
48
48
  %aside.four.columns
49
49
  %section
50
- %h1
50
+ %h2
51
51
  Recommend This Site
52
52
  %ul
53
53
  %li
@@ -56,7 +56,7 @@ body.articles {
56
56
  font-family: inherit;
57
57
  color: inherit;
58
58
  }
59
- h1 {
59
+ h2 {
60
60
  color: #444;
61
61
  border-bottom: 1px solid #ccc;
62
62
  font-size: 14px;
@@ -57,7 +57,7 @@ body.welcome {
57
57
  font-family: inherit;
58
58
  color: inherit;
59
59
  }
60
- h1 {
60
+ h2 {
61
61
  color: #444;
62
62
  border-bottom: 1px solid #ccc;
63
63
  font-size: 14px;
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module WebsiteBuilderEngine
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: website_builder_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-25 00:00:00.000000000Z
12
+ date: 2011-09-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &2161260280 !ruby/object:Gem::Requirement
16
+ requirement: &2153356780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2161260280
24
+ version_requirements: *2153356780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bson_ext
27
- requirement: &2161259840 !ruby/object:Gem::Requirement
27
+ requirement: &2153355520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2161259840
35
+ version_requirements: *2153355520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mongoid
38
- requirement: &2161259300 !ruby/object:Gem::Requirement
38
+ requirement: &2153354600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2161259300
46
+ version_requirements: *2153354600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: RedCloth
49
- requirement: &2161258740 !ruby/object:Gem::Requirement
49
+ requirement: &2153353960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2161258740
57
+ version_requirements: *2153353960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bourbon
60
- requirement: &2161258200 !ruby/object:Gem::Requirement
60
+ requirement: &2153353320 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2161258200
68
+ version_requirements: *2153353320
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: html2textile
71
- requirement: &2161257720 !ruby/object:Gem::Requirement
71
+ requirement: &2153352720 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2161257720
79
+ version_requirements: *2153352720
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: frontend-helpers
82
- requirement: &2161257180 !ruby/object:Gem::Requirement
82
+ requirement: &2153352060 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2161257180
90
+ version_requirements: *2153352060
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
- requirement: &2161256560 !ruby/object:Gem::Requirement
93
+ requirement: &2153344880 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '2.6'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2161256560
101
+ version_requirements: *2153344880
102
102
  description: Add this engine to any Rails 3.1 app and create static webpages from
103
103
  data added through a form.
104
104
  email:
@@ -168,6 +168,7 @@ files:
168
168
  - app/views/website_builder_engine/settings/index.html.haml
169
169
  - app/views/website_builder_engine/settings/new.html.haml
170
170
  - app/views/website_builder_engine/settings/show.html.haml
171
+ - app/views/website_builder_engine/templates/sitemap.xml.haml
171
172
  - app/views/website_builder_engine/welcome/template.html.haml
172
173
  - config/routes.rb
173
174
  - db/seeds.rb
@@ -222,8 +223,10 @@ files:
222
223
  - version.rb
223
224
  - website_builder_engine.gemspec
224
225
  - spec/dummy/log/development.log
226
+ - spec/dummy/public/howto/installing-rails-3-1.html
225
227
  - spec/dummy/public/howto/using-rails-3-1.html
226
228
  - spec/dummy/public/index.html
229
+ - spec/dummy/public/sitemap.xml
227
230
  - spec/dummy/tmp/cache/assets/C4A/470/sprockets%2F06a9301ff6c8e56320419f3591463c02
228
231
  - spec/dummy/tmp/cache/assets/C62/1D0/sprockets%2F1638f87db345b13872695759502b54fe
229
232
  - spec/dummy/tmp/cache/assets/C73/800/sprockets%2Fe26c7a52215e3d8315b952630b7d6230
@@ -366,7 +369,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
366
369
  version: '0'
367
370
  segments:
368
371
  - 0
369
- hash: -1298741027368882005
372
+ hash: 2462725749770464140
370
373
  required_rubygems_version: !ruby/object:Gem::Requirement
371
374
  none: false
372
375
  requirements:
@@ -375,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
378
  version: '0'
376
379
  segments:
377
380
  - 0
378
- hash: -1298741027368882005
381
+ hash: 2462725749770464140
379
382
  requirements: []
380
383
  rubyforge_project: website_builder_engine
381
384
  rubygems_version: 1.8.10
@@ -421,8 +424,10 @@ test_files:
421
424
  - spec/dummy/public/422.html
422
425
  - spec/dummy/public/500.html
423
426
  - spec/dummy/public/favicon.ico
427
+ - spec/dummy/public/howto/installing-rails-3-1.html
424
428
  - spec/dummy/public/howto/using-rails-3-1.html
425
429
  - spec/dummy/public/index.html
430
+ - spec/dummy/public/sitemap.xml
426
431
  - spec/dummy/Rakefile
427
432
  - spec/dummy/script/rails
428
433
  - spec/dummy/tmp/cache/assets/C4A/470/sprockets%2F06a9301ff6c8e56320419f3591463c02