mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add web manifest for Chrome users.
This commit is contained in:
15
app/controllers/manifest_json_controller.rb
Normal file
15
app/controllers/manifest_json_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class ManifestJsonController < ApplicationController
|
||||
layout false
|
||||
skip_before_filter :preload_json, :check_xhr
|
||||
|
||||
def index
|
||||
manifest = {
|
||||
short_name: SiteSetting.title,
|
||||
display: 'browser',
|
||||
orientation: 'portrait',
|
||||
start_url: "#{Discourse.base_uri}/"
|
||||
}
|
||||
|
||||
render json: manifest.to_json
|
||||
end
|
||||
end
|
||||
@@ -31,6 +31,7 @@
|
||||
<%- end %>
|
||||
|
||||
<%= render_google_universal_analytics_code %>
|
||||
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.json">
|
||||
|
||||
<%= yield :head %>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user