diff --git a/app/models/post.rb b/app/models/post.rb index 2f6bc6653..d8f26e865 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -196,6 +196,14 @@ class Post < ApplicationRecord "http://#{Danbooru.config.hostname}#{preview_file_url}" end + def open_graph_image_url + if is_image? && has_large? + "http://#{Danbooru.config.hostname}#{large_file_url}" + else + complete_preview_file_url + end + end + def file_url_for(user) if CurrentUser.mobile_mode? large_file_url diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 7fa0b6706..97bf19e60 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -174,7 +174,7 @@ <% if @post.visible? %> - + <% end %> <% if Danbooru.config.enable_post_search_counts %> @@ -189,7 +189,7 @@ <% if @post.visible? %> - + <% end %> <% end %>