From 8de048fcdb328167922f3056e460afc6f055cb8d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 7 Mar 2018 08:59:27 +0100 Subject: In wide layout, columnize Mastodon features on landing page (#6674) --- app/views/about/show.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views/about') diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index 4f3cedacd..d067d4874 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -103,8 +103,10 @@ - if Setting.timeline_preview .column-4.landing-page__information .landing-page__features - %h3= t 'about.what_is_mastodon' - %p= t 'about.about_mastodon_html' + .features-list + %div + %h3= t 'about.what_is_mastodon' + %p= t 'about.about_mastodon_html' = render 'features' -- cgit From 5acd5315f23b4472f31c4a0bb612b7356032defc Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 8 Mar 2018 11:10:37 +0100 Subject: Improve styling of closed registrations message, rename button (#6695) * Improve styling of closed registrations message, rename button "Sign up on another server" Fix #6683 * Adjust styling of closed registrations message --- app/javascript/styles/mastodon/about.scss | 22 ++++++++++++++++++++++ app/views/about/_forms.html.haml | 11 ++++++----- config/locales/en.yml | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'app/views/about') diff --git a/app/javascript/styles/mastodon/about.scss b/app/javascript/styles/mastodon/about.scss index f29918135..c484f074b 100644 --- a/app/javascript/styles/mastodon/about.scss +++ b/app/javascript/styles/mastodon/about.scss @@ -194,6 +194,28 @@ $small-breakpoint: 960px; } } + .closed-registrations-message { + margin-top: 20px; + + &, + p { + text-align: center; + font-size: 12px; + line-height: 18px; + color: $ui-primary-color; + margin-bottom: 0; + + a { + color: $ui-highlight-color; + text-decoration: underline; + } + } + + p:last-child { + margin-bottom: 0; + } + } + em { display: inline; margin: 0; diff --git a/app/views/about/_forms.html.haml b/app/views/about/_forms.html.haml index 9916b6bf4..81f7173f7 100644 --- a/app/views/about/_forms.html.haml +++ b/app/views/about/_forms.html.haml @@ -1,12 +1,13 @@ - if @instance_presenter.open_registrations = render 'registration' - else - - if @instance_presenter.closed_registrations_message.blank? - %p= t('about.closed_registrations') - - else - = @instance_presenter.closed_registrations_message.html_safe + = link_to t('auth.register_elsewhere'), 'https://joinmastodon.org', class: 'button button-primary' - = link_to t('auth.register'), 'https://joinmastodon.org', class: 'button button-primary' + .closed-registrations-message + - if @instance_presenter.closed_registrations_message.blank? + %p= t('about.closed_registrations') + - else + = @instance_presenter.closed_registrations_message.html_safe .separator-or %span= t('auth.or') diff --git a/config/locales/en.yml b/config/locales/en.yml index 176135657..2dd09626d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -376,6 +376,7 @@ en: cas: CAS saml: SAML register: Sign up + register_elsewhere: Sign up on another server resend_confirmation: Resend confirmation instructions reset_password: Reset password security: Security -- cgit From ff44b2e92d496c6027b20157fea6ebd885906bea Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 9 Mar 2018 00:35:07 +0100 Subject: Add missing meta description to profiles, some other SEO stuff (#6706) - Add missing meta description to profiles - Add canonical rel link to landing page - Remove linebreaks from title tags - Add username to profile title - Add toots/following/followers to profile description tags - Add next/prev rel links to profiles - Do not index follower/following variants of profiles --- app/helpers/stream_entries_helper.rb | 21 +++++++++++++++++++++ app/views/about/show.html.haml | 1 + app/views/accounts/_og.html.haml | 2 +- app/views/accounts/show.html.haml | 13 ++++++++++--- app/views/follower_accounts/index.html.haml | 4 +--- app/views/following_accounts/index.html.haml | 4 +--- app/views/layouts/application.html.haml | 8 ++------ 7 files changed, 37 insertions(+), 16 deletions(-) (limited to 'app/views/about') diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index 445114985..54b92bdf4 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -8,6 +8,27 @@ module StreamEntriesHelper account.display_name.presence || account.username end + def account_description(account) + prepend_str = [ + [ + number_to_human(account.statuses_count, strip_insignificant_zeros: true), + t('accounts.posts'), + ].join(' '), + + [ + number_to_human(account.following_count, strip_insignificant_zeros: true), + t('accounts.following'), + ].join(' '), + + [ + number_to_human(account.followers_count, strip_insignificant_zeros: true), + t('accounts.followers'), + ].join(' '), + ].join(', ') + + [prepend_str, account.note].join(' ยท ') + end + def stream_link_target embedded_view? ? '_blank' : nil end diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index d067d4874..dbb914f11 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -2,6 +2,7 @@ = site_hostname - content_for :header_tags do + %link{ rel: 'canonical', href: about_url }/ %script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json) = javascript_pack_tag 'about', integrity: true, crossorigin: 'anonymous' = render partial: 'shared/og' diff --git a/app/views/accounts/_og.html.haml b/app/views/accounts/_og.html.haml index 1d16be590..26424a49c 100644 --- a/app/views/accounts/_og.html.haml +++ b/app/views/accounts/_og.html.haml @@ -1,7 +1,7 @@ = opengraph 'og:url', url = opengraph 'og:site_name', site_title = opengraph 'og:title', [yield(:page_title).strip.presence, site_title].compact.join(' - ') -= opengraph 'og:description', account.note += opengraph 'og:description', account_description(account) = opengraph 'og:image', full_asset_url(account.avatar.url(:original)) = opengraph 'og:image:width', '120' = opengraph 'og:image:height', '120' diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index 21c585dab..c62a573b0 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -1,7 +1,9 @@ - content_for :page_title do - = display_name(@account) + = "#{display_name(@account)} (@#{@account.username})" - content_for :header_tags do + %meta{ name: 'description', content: account_description(@account) }/ + - if @account.user&.setting_noindex %meta{ name: 'robots', content: 'noindex' }/ @@ -9,6 +11,11 @@ %link{ rel: 'alternate', type: 'application/atom+xml', href: account_url(@account, format: 'atom') }/ %link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(@account) }/ + - if @older_url + %link{ rel: 'next', href: @older_url }/ + - if @newer_url + %link{ rel: 'prev', href: @newer_url }/ + = opengraph 'og:type', 'profile' = render 'og', account: @account, url: short_account_url(@account, only_path: false) @@ -42,6 +49,6 @@ - if @newer_url || @older_url .pagination - if @older_url - = link_to safe_join([fa_icon('chevron-left'), t('pagination.older')], ' '), @older_url, class: 'older', rel: 'older' + = link_to safe_join([fa_icon('chevron-left'), t('pagination.older')], ' '), @older_url, class: 'older', rel: 'next' - if @newer_url - = link_to safe_join([t('pagination.newer'), fa_icon('chevron-right')], ' '), @newer_url, class: 'newer', rel: 'newer' + = link_to safe_join([t('pagination.newer'), fa_icon('chevron-right')], ' '), @newer_url, class: 'newer', rel: 'prev' diff --git a/app/views/follower_accounts/index.html.haml b/app/views/follower_accounts/index.html.haml index 738b31638..a24e4ea20 100644 --- a/app/views/follower_accounts/index.html.haml +++ b/app/views/follower_accounts/index.html.haml @@ -2,9 +2,7 @@ = t('accounts.people_who_follow', name: display_name(@account)) - content_for :header_tags do - - if @account.user&.setting_noindex - %meta{ name: 'robots', content: 'noindex' }/ - + %meta{ name: 'robots', content: 'noindex' }/ = render 'accounts/og', account: @account, url: account_followers_url(@account, only_path: false) = render 'accounts/header', account: @account diff --git a/app/views/following_accounts/index.html.haml b/app/views/following_accounts/index.html.haml index 9637c689f..67f6cfede 100644 --- a/app/views/following_accounts/index.html.haml +++ b/app/views/following_accounts/index.html.haml @@ -2,9 +2,7 @@ = t('accounts.people_followed_by', name: display_name(@account)) - content_for :header_tags do - - if @account.user&.setting_noindex - %meta{ name: 'robots', content: 'noindex' }/ - + %meta{ name: 'robots', content: 'noindex' }/ = render 'accounts/og', account: @account, url: account_followers_url(@account, only_path: false) = render 'accounts/header', account: @account diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index f38c59165..b26d2c509 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,7 @@ %html{ lang: I18n.locale } %head %meta{ charset: 'utf-8' }/ - %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }/ + %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }/ %link{ rel: 'icon', href: favicon_path, type: 'image/x-icon' }/ %link{ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }/ %link{ rel: 'mask-icon', href: '/mask-icon.svg', color: '#2B90D9' }/ @@ -11,11 +11,7 @@ %meta{ name: 'theme-color', content: '#282c37' }/ %meta{ name: 'apple-mobile-web-app-capable', content: 'yes' }/ - %title< - - if content_for?(:page_title) - = yield(:page_title) - = ' - ' - = title + %title= content_for?(:page_title) ? safe_join([yield(:page_title).chomp, ' - ', title]) : title = stylesheet_pack_tag 'common', media: 'all' = stylesheet_pack_tag current_theme, media: 'all' -- cgit