The discussion revolves around the absence of OpenGraph meta data on the login page of a Discourse instance, which affects social media previews when sharing URLs. RGJ notes that without OG tags like og:image and twitter:image, social platforms display default or incorrect images. awesomerobot explains that the meta data can be added by modifying the login.html.erb template in a plugin, suggesting the same code used on other pages like show.html.erb. They believe the omission isn’t due to privacy concerns and that the necessary data is already available. techAPJ agrees and confirms the fix has been implemented in a commit.
One of our customers discourse instance is configured that people have to register before they can access the content. One unwanted side-effect is when people share the URL of the website on social media the preview image shown on Facebook and Twitter is not their default opengraph image or twitter summary large image. On the login page the og:image and twitter:image html tags are not used in the HTML.
Currently there is no Opengraph meta data on the login page. Is this intentional? How would we be able to work around that?
It would probably be as simple as adding this (which is what we do in show.html.erb)
<% if @title %>
<% content_for :title do %><%= @title %><% end %>
<% content_for :head do %>
<%= raw crawlable_meta_data(title: @title, description: SiteSetting.site_description) %>
<% end %>
<% else %>
<% content_for :head do %>
<%= raw crawlable_meta_data(title: SiteSetting.title, description: SiteSetting.site_description) %>
<% end %>
<% end %>
I think all the data that gets used for OG Meta tags is already present on the login page… so I don’t think it’s omitted for privacy reasons or anything? Seems like we should add it.