effective_pages 1.0.0 → 1.0.1

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: 3bc19d5b5eda0252766bbd2513e782fd925da9fc
4
- data.tar.gz: 3620e81396759b954a6328df256639e913330ee4
3
+ metadata.gz: 75c2f5f0790658fbeb18efcd73a56478c2f98735
4
+ data.tar.gz: e4ae5f5519ed72b9d36c94baf03d36ee86e98727
5
5
  SHA512:
6
- metadata.gz: 8aafde81d48bb3438b64dc9a4265bdc38dbe8a563569ddad22b6bddf8655e0c242bfed9d3ab77d29e4192213b2eb4c4ba634a34e97e34b207bbcfafa20d1d162
7
- data.tar.gz: a09250b2ff6d92299541e42ad7c4adaa20921e99162be39a38f411f73e1b41b982615298b3d858182a2f15402fed02dbc661ad8492d3d5bc8aa83db5fdd92b90
6
+ metadata.gz: 255f33adf3c870eaa47d41f5990d5e92e6d8713d0ae4acf33186ebf382536efd33aaeb7ff4f752adc271f69b4e5854177b39f992670c9c7583f9f176cf4044f3
7
+ data.tar.gz: 5554c3b647c5bf9881288c4451b33975a4ae4a453dd2a36166ddb579c9ac190da6fedb4e6b8d4392e3f529bb38c29eeaa03e8e36c3100ef2cf4ddb4c73547b65
data/README.md CHANGED
@@ -137,7 +137,7 @@ In your application layout and any additional layouts files, add the following t
137
137
 
138
138
  This helper inserts a `<title>...</title>` html tag based on the `@page_title` instance variable, which you can set anywhere on your non-effective controllers, and whose value is set to the `@page.title` value when displaying an `Effective::Page`.
139
139
 
140
- This helper also inserts a `<meta name='description' value='...' />` html tag based on the Effective::Page's meta description value. This tag provides the content that search engines use to display their search results.
140
+ This helper also inserts a `<meta name='description' content='...' />` html tag based on the `@meta_description` instance variable, which you can set anywhere on your non-effective controllers, and whose value is set to the `@page.meta_description` value when displaying an `Effective::Page`. This tag provides the content that search engines use to display their search results. This value will automatically be truncated to 150 characters.
141
141
 
142
142
  This helper is entirely optional and in no way required for effective_pages to work.
143
143
 
@@ -22,8 +22,10 @@ module EffectivePagesHelper
22
22
  end
23
23
 
24
24
  def effective_pages_meta_description_tag
25
- if @page.try(:meta_description).present?
26
- "<meta content='#{@page.try(:meta_description)}' name='description' />"
25
+ if @meta_description.present?
26
+ "<meta content='#{truncate(@meta_description, :length => 150)}' name='description' />"
27
+ elsif @page.try(:meta_description).present?
28
+ "<meta content='#{@page.meta_description}' name='description' />"
27
29
  end
28
30
  end
29
31
 
@@ -10,7 +10,7 @@ module Effective
10
10
 
11
11
  structure do
12
12
  title :string, :validates => [:presence, :length => {:maximum => 255}]
13
- meta_description :string, :validates => [:presence, :length => {:maximum => 255}]
13
+ meta_description :string, :validates => [:presence, :length => {:maximum => 150}]
14
14
 
15
15
  draft :boolean, :default => false
16
16
 
@@ -1,12 +1,12 @@
1
1
  = simple_form_for(page, (EffectivePages.simple_form_options || {}).merge(:url => (page.persisted? ? effective_pages.admin_page_path(page.id) : effective_pages.admin_pages_path))) do |f|
2
- = f.input :title, :hint => "Give this page a title"
2
+ = f.input :title, :hint => "Give this page a title", :input_html => {:maxlength => 255}
3
3
  = f.input :draft, :hint => "Save this page as a draft. It will not be accessible on the website."
4
4
 
5
5
  - if !f.object.new_record? || f.object.errors.include?(:slug)
6
6
  - current_url = (effective_pages.page_url(f.object) rescue nil)
7
7
  = f.input :slug, :hint => "The slug controls this page's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This page is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url }".html_safe
8
8
 
9
- = f.input :meta_description, :hint => "A one or two sentence summary of this page. Appears on Google search results underneath the page title."
9
+ = f.input :meta_description, :hint => "A one or two sentence summary of this page. Appears on Google search results underneath the page title.", :input_html => {:maxlength => 150}
10
10
 
11
11
  - if EffectivePages.pages.length == 1
12
12
  = f.input :template, :as => :hidden, :value => EffectivePages.pages.first
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails