config: rename twitter_site to twitter_username.

This commit is contained in:
evazion
2020-05-08 16:56:21 -05:00
parent 8dedce0944
commit 71ec4cc498
2 changed files with 10 additions and 7 deletions

View File

@@ -19,7 +19,7 @@
<% if CurrentUser.user.custom_style.present? && params.fetch(:css, "true").truthy? %> <% 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" %> <%= stylesheet_link_tag custom_style_users_path(md5: Digest::MD5.hexdigest(CurrentUser.user.custom_style)), media: "screen" %>
<% end %> <% end %>
<% if Danbooru.config.twitter_site %> <% if Danbooru.config.twitter_username.present? %>
<script type="application/ld+json"> <script type="application/ld+json">
{ {
"@context" : "http://schema.org", "@context" : "http://schema.org",
@@ -27,7 +27,7 @@
"name" : "<%= Danbooru.config.app_name %>", "name" : "<%= Danbooru.config.app_name %>",
"url" : "<%= root_url %>", "url" : "<%= root_url %>",
"sameAs" : [ "sameAs" : [
"https://twitter.com/<%= Danbooru.config.twitter_site[1..-1] %>" "https://twitter.com/<%= Danbooru.config.twitter_username %>"
] ]
} }
</script> </script>
@@ -70,12 +70,13 @@
<%= tag.meta property: "og:description", content: meta_description %> <%= tag.meta property: "og:description", content: meta_description %>
<%= tag.meta property: "og:url", content: request.original_url %> <%= tag.meta property: "og:url", content: request.original_url %>
<% if Danbooru.config.twitter_site.present? %> <% if Danbooru.config.twitter_username.present? %>
<%= tag.meta name: "twitter:site", content: Danbooru.config.twitter_site %> <%= tag.meta name: "twitter:site", content: "@#{Danbooru.config.twitter_username}" %>
<%= tag.meta name: "twitter:title", content: page_title %>
<%= tag.meta name: "twitter:description", content: meta_description %>
<% end %> <% end %>
<%= tag.meta name: "twitter:title", content: page_title %>
<%= tag.meta name: "twitter:description", content: meta_description %>
<%= yield :html_header %> <%= yield :html_header %>
<%= raw Danbooru.config.custom_html_header_content %> <%= raw Danbooru.config.custom_html_header_content %>
</head> </head>

View File

@@ -425,7 +425,9 @@ module Danbooru
end end
end end
def twitter_site # The twitter username associated with this site (username only, don't include the @-sign).
def twitter_username
nil
end end
# include essential tags in image urls (requires nginx/apache rewrites) # include essential tags in image urls (requires nginx/apache rewrites)