about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/accounts/_og.html.haml7
-rw-r--r--app/views/accounts/show.html.haml8
-rw-r--r--app/views/follower_accounts/index.html.haml3
-rw-r--r--app/views/following_accounts/index.html.haml3
4 files changed, 14 insertions, 7 deletions
diff --git a/app/views/accounts/_og.html.haml b/app/views/accounts/_og.html.haml
new file mode 100644
index 000000000..b7f019c50
--- /dev/null
+++ b/app/views/accounts/_og.html.haml
@@ -0,0 +1,7 @@
+%meta{ property: 'og:site_name', content: site_title }/
+%meta{ property: 'og:title', content: [yield(:page_title).strip.presence, site_title].compact.join(' - ') }/
+%meta{ property: 'og:description', content: account.note }/
+%meta{ property: 'og:image', content: full_asset_url(account.avatar.url(:original)) }/
+%meta{ property: 'og:image:width', content: '120' }/
+%meta{ property: 'og:image:height', content: '120' }/
+%meta{ property: 'twitter:card', content: 'summary' }/
diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml
index 44d66d471..4611155cd 100644
--- a/app/views/accounts/show.html.haml
+++ b/app/views/accounts/show.html.haml
@@ -5,14 +5,8 @@
   %link{ rel: 'salmon', href: api_salmon_url(@account.id) }/
   %link{ rel: 'alternate', type: 'application/atom+xml', href: account_url(@account, format: 'atom') }/
 
-  %meta{ property: 'og:site_name', content: site_title }/
   %meta{ property: 'og:type', content: 'profile' }/
-  %meta{ property: 'og:title', content: "#{@account.username} on #{site_hostname}" }/
-  %meta{ property: 'og:description', content: @account.note }/
-  %meta{ property: 'og:image', content: full_asset_url(@account.avatar.url(:original)) }/
-  %meta{ property: 'og:image:width', content: '120' }/
-  %meta{ property: 'og:image:height', content: '120' }/
-  %meta{ property: 'twitter:card', content: 'summary' }/
+  = render 'og', account: @account
 
 - if show_landing_strip?
   = render partial: 'shared/landing_strip', locals: { account: @account }
diff --git a/app/views/follower_accounts/index.html.haml b/app/views/follower_accounts/index.html.haml
index c30d601e6..4052967da 100644
--- a/app/views/follower_accounts/index.html.haml
+++ b/app/views/follower_accounts/index.html.haml
@@ -1,6 +1,9 @@
 - content_for :page_title do
   = t('accounts.people_who_follow', name: display_name(@account))
 
+- content_for :header_tags do
+  = render 'accounts/og', account: @account
+
 = render 'accounts/header', account: @account
 
 = render 'accounts/follow_grid', accounts: @accounts
diff --git a/app/views/following_accounts/index.html.haml b/app/views/following_accounts/index.html.haml
index cd3737591..11e730e04 100644
--- a/app/views/following_accounts/index.html.haml
+++ b/app/views/following_accounts/index.html.haml
@@ -1,6 +1,9 @@
 - content_for :page_title do
   = t('accounts.people_followed_by', name: display_name(@account))
 
+- content_for :header_tags do
+  = render 'accounts/og', account: @account
+
 = render 'accounts/header', account: @account
 
 = render 'accounts/follow_grid', accounts: @accounts