Update account, status meta tags

• Update:
- account, status meta tags
This commit is contained in:
mgabdev
2020-05-26 20:12:19 -04:00
parent 7483c1de2c
commit 8d6d85f829
39 changed files with 49 additions and 69 deletions

View File

@@ -1,9 +1,7 @@
- content_for :page_title do
= "#{display_name(account)} (@#{account.local_username_and_domain}) | #{site_hostname}"
= "#{display_name(account)} (@#{account.username}) #{site_hostname}"
- content_for :header_tags do
%meta{ name: 'description', content: account_description(account) }/
- if account.user&.setting_noindex
%meta{ name: 'robots', content: 'noindex' }/
@@ -12,10 +10,10 @@
%link{ rel: 'alternate', type: 'application/rss+xml', href: account_url(account, format: 'rss') }/
%link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(account) }/
= opengraph 'og:type', 'profile'
= render 'accounts/og', account: account, url: short_account_url(account, only_path: false)
- if older_url
%link{ rel: 'next', href: older_url }/
- if newer_url
%link{ rel: 'prev', href: newer_url }/
= opengraph 'og:type', 'profile'
= render 'accounts/og', account: account, url: short_account_url(account, only_path: false)

View File

@@ -4,7 +4,7 @@
= opengraph 'og:url', url
= opengraph 'og:site_name', site_title
= opengraph 'og:title', yield(:page_title).strip
= opengraph 'og:title', "#{display_name(account)} (@#{account.username}) • #{site_hostname}"
= opengraph 'og:description', description
= opengraph 'og:image', full_asset_url(account.avatar.url(:original))
= opengraph 'og:image:width', '120'

View File

@@ -32,9 +32,7 @@
%meta{ name: 'apple-mobile-web-app-capable', content: 'yes' }/
%meta{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' }/
- if @tag
= render 'tags/meta', tag: @tag, initial_state_json: @initial_state_json
- elsif @stream_entry && @account
- if @stream_entry && @account
= render 'stream_entries/meta', stream_entry: @stream_entry, account: @account
- elsif @account && @account.local?
= render 'accounts/meta', account: @account, older_url: nil, newer_url: nil

View File

@@ -1,5 +1,5 @@
- content_for :page_title do
= t('statuses.title', name: display_name(account), quote: truncate(stream_entry.activity.spoiler_text.presence || stream_entry.activity.text, length: 50, omission: '…', escape: false)) + " | #{site_hostname}"
= t('statuses.title', name: display_name(account), quote: truncate(stream_entry.activity.spoiler_text.presence || stream_entry.activity.text, length: 50, omission: '…', escape: false))
- content_for :header_tags do
- if account.user&.setting_noindex
@@ -11,8 +11,8 @@
= opengraph 'og:site_name', site_title
= opengraph 'og:type', 'article'
= opengraph 'og:title', "#{display_name(account)} (@#{account.local_username_and_domain})"
= opengraph 'og:title', t('statuses.title', name: display_name(account), quote: truncate(stream_entry.activity.spoiler_text.presence || stream_entry.activity.text, length: 50, omission: '…', escape: false))
= opengraph 'og:url', short_account_status_url(account, stream_entry.activity)
= render 'stream_entries/og_description', activity: stream_entry.activity
= render 'stream_entries/og_description', activity: stream_entry.activity, account: account
= render 'stream_entries/og_image', activity: stream_entry.activity, account: account

View File

@@ -1,4 +1,4 @@
- description = status_description(activity)
- description = t('statuses.title', name: display_name(account), quote: truncate(activity.spoiler_text.presence || activity.text, length: 50, omission: '…', escape: false))
%meta{ name: 'description', content: description }/
= opengraph 'og:description', description