about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-06 19:29:42 +0200
committerGitHub <noreply@github.com>2017-06-06 19:29:42 +0200
commit722d152082a20c96ca6f1db92c172f9d3772d737 (patch)
treee725bfc2f9688117782bec78bbaa8321a8344877 /app
parent7623766241862d2ede47558639c357d57b769e3b (diff)
Fix #3063 - Add dynamic app manifest (#3563)
* Fix #3063 - Add dynamic app manifest

* Added short_name

* Add background_color
Diffstat (limited to 'app')
-rw-r--r--app/controllers/manifests_controller.rb11
-rw-r--r--app/views/manifests/show.json.rabl11
2 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/manifests_controller.rb b/app/controllers/manifests_controller.rb
new file mode 100644
index 000000000..832e1eb6f
--- /dev/null
+++ b/app/controllers/manifests_controller.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ManifestsController < ApplicationController
+  before_action :set_instance_presenter
+
+  def show; end
+
+  def set_instance_presenter
+    @instance_presenter = InstancePresenter.new
+  end
+end
diff --git a/app/views/manifests/show.json.rabl b/app/views/manifests/show.json.rabl
new file mode 100644
index 000000000..0aa1728e7
--- /dev/null
+++ b/app/views/manifests/show.json.rabl
@@ -0,0 +1,11 @@
+object false
+
+node(:name)             { Setting.site_title }
+node(:short_name)       { Setting.site_title }
+node(:description)      { strip_tags(Setting.site_description.presence || I18n.t('about.about_mastodon')) }
+node(:icons)            { [{ src: '/android-chrome-192x192.png', sizes: '192x192', type: 'image/png' }] }
+node(:theme_color)      { '#282c37' }
+node(:background_color) { '#d9e1e8' }
+node(:display)          { 'standalone' }
+node(:start_url)        { '/web/timelines/home' }
+node(:scope)            { root_url }