effective_pages 2.0.5 → 2.0.6
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398c1e27018e91e6b525023eb4436e1996e5d6bf27a709b6ffcfb28f2a1244aa
|
4
|
+
data.tar.gz: ba5550d8d643d97c3bc28b16150332d5a6a82b030e021044dc69b5e4639992ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c071da921b8873e0160aacc25344307f0e592900216b43f2aa523fb5debd6b200c6c14f1a753351bfed8d772aa7f808aeed66ad58d68e83ab72a1c7a82747c78
|
7
|
+
data.tar.gz: 7824e33d15accde33a03b86d8066ae965925f12222d9f6076a55e147929fc7c718314ddd80179d1ae4c130bacc57cac9e954be441a82a82710d7348e2a866948
|
@@ -39,14 +39,18 @@ module EffectivePagesHelper
|
|
39
39
|
]
|
40
40
|
|
41
41
|
if EffectivePages.site_og_image_width.present?
|
42
|
-
tags << tag(:meta, property: 'og:image:width', content: EffectivePages.site_og_image_width)
|
42
|
+
tags << tag(:meta, property: 'og:image:width', content: EffectivePages.site_og_image_width)
|
43
43
|
end
|
44
44
|
|
45
45
|
if EffectivePages.site_og_image_height.present?
|
46
|
-
tags << tag(:meta, property: 'og:image:height', content: EffectivePages.site_og_image_height)
|
46
|
+
tags << tag(:meta, property: 'og:image:height', content: EffectivePages.site_og_image_height)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
if effective_pages_canonical_url.present?
|
51
|
+
tags << tag(:link, rel: 'canonical', href: effective_pages_canonical_url)
|
52
|
+
end
|
53
|
+
|
50
54
|
tags.compact.join("\n").html_safe
|
51
55
|
end
|
52
56
|
|
@@ -70,6 +74,14 @@ module EffectivePagesHelper
|
|
70
74
|
truncate((@meta_description || EffectivePages.fallback_meta_description).to_s, length: 150)
|
71
75
|
end
|
72
76
|
|
77
|
+
def effective_pages_canonical_url
|
78
|
+
unless @canonical_url.present? || EffectivePages.silence_missing_canonical_url_warnings
|
79
|
+
Rails.logger.error("WARNING: (effective_pages) Expected @canonical_url to be present. Please assign a @canonical_url variable in your controller action.")
|
80
|
+
end
|
81
|
+
|
82
|
+
@canonical_url
|
83
|
+
end
|
84
|
+
|
73
85
|
def effective_pages_og_type
|
74
86
|
@effective_pages_og_type || 'website'
|
75
87
|
end
|
data/config/effective_pages.rb
CHANGED
@@ -37,6 +37,8 @@ EffectivePages.setup do |config|
|
|
37
37
|
# Turn off missing meta page title and meta description warnings
|
38
38
|
config.silence_missing_page_title_warnings = false
|
39
39
|
config.silence_missing_meta_description_warnings = false
|
40
|
+
config.silence_missing_canonical_url_warnings = false
|
41
|
+
|
40
42
|
|
41
43
|
# Display the effective roles 'choose roles' input when an admin creates a new post
|
42
44
|
config.use_effective_roles = false
|
data/lib/effective_pages.rb
CHANGED
@@ -23,7 +23,8 @@ module EffectivePages
|
|
23
23
|
|
24
24
|
mattr_accessor :silence_missing_page_title_warnings
|
25
25
|
mattr_accessor :silence_missing_meta_description_warnings
|
26
|
-
|
26
|
+
mattr_accessor :silence_missing_canonical_url_warnings
|
27
|
+
|
27
28
|
mattr_accessor :use_effective_roles
|
28
29
|
|
29
30
|
mattr_accessor :menu
|
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: 2.0.
|
4
|
+
version: 2.0.6
|
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: 2019-06-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|