9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/johnhenry/application_controller.rb', line 9
def set_meta_tag_defaults
{
title: DEFAULT_TITLE,
description: DEFAULT_DESCRIPTION,
language: 'english',
viewport: 'width=device-width, initial-scale=1, maximum-scale=1',
robots: 'index, follow',
og: {
title: DEFAULT_TITLE,
description: DEFAULT_DESCRIPTION,
image: 'http://placekitten.com/400/400',
type: 'website' }
}.tap do |meta_tags|
%w(fb:admins fb:app_id).each do |fb_key|
env_key = fb_key.upcase.sub(':', '_')
if ENV[env_key].present?
meta_tags[fb_key] = ENV[env_key]
end
end
if defined?(set_meta)
set_meta meta_tags
end
end
end
|