Skip to content

Commit 5fe4a0e

Browse files
authored
Merge pull request #2495 from mroderick/no-og-tags-on-admin
chore: remove social preview on admin pages
2 parents 6906388 + 6e999af commit 5fe4a0e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

app/controllers/application_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def manager?
117117
end
118118

119119
helper_method :manager?
120+
helper_method :admin_namespace?
120121

121122
def is_logged_in?
122123
unless logged_in?
@@ -129,6 +130,10 @@ def has_access?
129130
is_logged_in?
130131
end
131132

133+
def admin_namespace?
134+
controller_path.start_with?('admin/', 'super_admin/')
135+
end
136+
132137
private
133138

134139
def set_locale

app/views/layouts/application.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- if content_for? :meta_tags
1212
= yield :meta_tags
13-
- else
13+
- elsif !admin_namespace?
1414
= render partial: 'shared/meta_tags'
1515

1616
%link{ rel: 'icon', sizes: '196x196', href: '/Icon-196.png'}

0 commit comments

Comments
 (0)