diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index 4c8cd4c2a..03d11c3c5 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -19,7 +19,7 @@
<% if CurrentUser.user.custom_style.present? && params.fetch(:css, "true").truthy? %>
<%= stylesheet_link_tag custom_style_users_path(md5: Digest::MD5.hexdigest(CurrentUser.user.custom_style)), media: "screen" %>
<% end %>
- <% if Danbooru.config.twitter_site %>
+ <% if Danbooru.config.twitter_username.present? %>
@@ -70,12 +70,13 @@
<%= tag.meta property: "og:description", content: meta_description %>
<%= tag.meta property: "og:url", content: request.original_url %>
- <% if Danbooru.config.twitter_site.present? %>
- <%= tag.meta name: "twitter:site", content: Danbooru.config.twitter_site %>
- <%= tag.meta name: "twitter:title", content: page_title %>
- <%= tag.meta name: "twitter:description", content: meta_description %>
+ <% if Danbooru.config.twitter_username.present? %>
+ <%= tag.meta name: "twitter:site", content: "@#{Danbooru.config.twitter_username}" %>
<% end %>
+ <%= tag.meta name: "twitter:title", content: page_title %>
+ <%= tag.meta name: "twitter:description", content: meta_description %>
+
<%= yield :html_header %>
<%= raw Danbooru.config.custom_html_header_content %>
diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb
index 6a0b7f030..5b728f4d5 100644
--- a/config/danbooru_default_config.rb
+++ b/config/danbooru_default_config.rb
@@ -425,7 +425,9 @@ module Danbooru
end
end
- def twitter_site
+ # The twitter username associated with this site (username only, don't include the @-sign).
+ def twitter_username
+ nil
end
# include essential tags in image urls (requires nginx/apache rewrites)