effective_pages 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/helpers/effective_pages_helper.rb +12 -3
- data/config/effective_pages.rb +7 -1
- data/lib/effective_pages/version.rb +1 -1
- data/lib/effective_pages.rb +2 -0
- 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: 587508cec2b677dd7fe58c72c21959f0d197c1c9
|
4
|
+
data.tar.gz: f74c3e83c9185298f302b32ca4425e2a8d3c0dc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d3bd9324ee7858b41016218c9150de0ef47d24e9a993e6e646173d2b50f8c436a0cac489aeca640b31e4626c8814ff3adc14cba7104dd59a5faa9f19457e4c
|
7
|
+
data.tar.gz: 9c13ffda03b844cab226b6b8f40829e491d35065534b5691f2f71f7d516fd980e6832a242f9d53101531228d03e95ce45e134bede7592d1a29fe712e2b75fa7f
|
data/README.md
CHANGED
@@ -47,13 +47,13 @@ Then migrate the database:
|
|
47
47
|
rake db:migrate
|
48
48
|
```
|
49
49
|
|
50
|
-
Add the following helper to your application layout in the `<head>..</head>` section. This will properly create `<title>` and `<meta description>` tags based on the Effective::Page and the controller instance variables `@page_title` and `@meta_description` for non Effective::Page routes.
|
50
|
+
Add the following helper to your application layout in the `<head>..</head>` section. This will properly create `<title>` and `<meta description>` tags based on the Effective::Page and the controller instance variables `@page_title` and `@meta_description` for non Effective::Page routes. It will also create additional Open Graph tags based on the initializer.
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
= effective_pages_header_tags
|
54
54
|
```
|
55
55
|
|
56
|
-
There are no required javascript or stylesheet includes.
|
56
|
+
There are no required javascript or stylesheet includes, but you will want to ensure there is an Open Graph compatible image available in your assets folder.
|
57
57
|
|
58
58
|
|
59
59
|
### Post Installation
|
@@ -13,16 +13,25 @@ module EffectivePagesHelper
|
|
13
13
|
def effective_pages_header_tags
|
14
14
|
[
|
15
15
|
content_tag(:title, effective_pages_site_title),
|
16
|
-
tag(:meta, name: 'description'.freeze, content: effective_pages_meta_description)
|
16
|
+
tag(:meta, name: 'description'.freeze, content: effective_pages_meta_description),
|
17
|
+
tag(:meta, property: 'og:site_name', content: EffectivePages.site_title.to_s),
|
18
|
+
tag(:meta, property: 'og:title', content: effective_pages_page_title),
|
19
|
+
tag(:meta, property: 'og:description', content: effective_pages_meta_description),
|
20
|
+
tag(:meta, property: 'og:url', content: request.original_url),
|
21
|
+
tag(:meta, property: 'og:image', content: asset_path(EffectivePages.site_og_image.to_s))
|
17
22
|
].compact.join("\n").html_safe
|
18
23
|
end
|
19
24
|
|
20
|
-
def
|
25
|
+
def effective_pages_page_title
|
21
26
|
unless @page_title.present? || EffectivePages.silence_missing_page_title_warnings
|
22
27
|
Rails.logger.error("WARNING: (effective_pages) Expected @page_title to be present. Please assign a @page_title variable in your controller action.")
|
23
28
|
end
|
24
29
|
|
25
|
-
(@page_title || "#{params[:controller].try(:titleize)} #{params[:action].try(:titleize)}")
|
30
|
+
(@page_title || "#{params[:controller].try(:titleize)} #{params[:action].try(:titleize)}")
|
31
|
+
end
|
32
|
+
|
33
|
+
def effective_pages_site_title
|
34
|
+
effective_pages_page_title + EffectivePages.site_title_suffix.to_s
|
26
35
|
end
|
27
36
|
|
28
37
|
def effective_pages_meta_description
|
data/config/effective_pages.rb
CHANGED
@@ -17,9 +17,15 @@ EffectivePages.setup do |config|
|
|
17
17
|
# Any app/views/layouts/ layout files that should be excluded
|
18
18
|
config.excluded_layouts = [:admin]
|
19
19
|
|
20
|
-
#
|
20
|
+
# The site_title will be used to populate the og:site_name tag
|
21
|
+
config.site_title = "#{Rails.application.class.name.split('::').first.titleize}"
|
22
|
+
|
23
|
+
# The site_title_suffix will be appended to the effective_pages_header_tags title tag
|
21
24
|
config.site_title_suffix = " | #{Rails.application.class.name.split('::').first.titleize}"
|
22
25
|
|
26
|
+
# This site_og_image is the filename for an image placed in /assets/images and will be used to populate the og:image tag
|
27
|
+
config.site_og_image = ''
|
28
|
+
|
23
29
|
# When using the effective_pages_header_tags() helper in <head> to set the <meta name='description'>
|
24
30
|
# The value will be populated from an Effective::Page's .meta_description field,
|
25
31
|
# a present @meta_description controller instance variable or this fallback value.
|
data/lib/effective_pages.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.3
|
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: 2017-
|
11
|
+
date: 2017-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|