discourse/app/views/layouts/embed.html.erb
Penar Musaraj a86112fc25
FEATURE: Allow embedded view to include a header (#20150)
This commits adds the ability to add a header to the embedded comments
view. One use case for this is to allow `postMessage` communication
between the comments iframe and the parent frame, for example, when
toggling the theme of the parent webpage.
2023-02-06 11:10:50 -05:00

26 lines
836 B
Plaintext

<!DOCTYPE html>
<html<%= raw @embeddable_css_class -%>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=yes, viewport-fit=cover">
<%= discourse_stylesheet_link_tag 'embed', theme_id: nil %>
<%- unless customization_disabled? %>
<%= discourse_stylesheet_link_tag :embedded_theme %>
<%- end %>
<%= preload_script 'break_string' %>
<%- if @topic_view && @topic_view.page_title.present? %>
<title><%= @topic_view.page_title %> - <%= SiteSetting.title %></title>
<%- end %>
<meta id="data-embedded" data-referer="<%= @data_referer %>">
<%= preload_script 'embed-application' %>
<%= yield :head %>
</head>
<body>
<%= theme_lookup("embedded_header") %>
<%= yield %>
</body>
</html>