From 9e97357524fa24af651ef2b5e3e606c1e392f77b Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sat, 9 Sep 2017 16:57:42 -0400 Subject: [PATCH] Add web app manifest --- lib/app.rb | 2 +- public/manifest.json | 34 ++++++++++++++++++++++++++++++++++ views/index.erb | 1 + views/other.erb | 1 + 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 public/manifest.json diff --git a/lib/app.rb b/lib/app.rb index 3841bde3..45d08270 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -74,7 +74,7 @@ class App < Sinatra::Application use Rack::Deflater use Rack::Static, root: 'public', - urls: %w(/assets /docs/ /images /favicon.ico /robots.txt /opensearch.xml /mathml.css), + urls: %w(/assets /docs/ /images /favicon.ico /robots.txt /opensearch.xml /mathml.css /manifest.json), header_rules: [ [:all, {'Cache-Control' => 'no-cache, max-age=0'}], ['/assets', {'Cache-Control' => 'public, max-age=604800'}], diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 00000000..c3ddeca4 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,34 @@ +{ + "name": "DevDocs", + "short_name": "DevDocs", + "description": "API Documentation Browser", + "start_url": "/", + "display": "standalone", + "icons": [ + { + "src": "/images/webapp-icon-32.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "/images/webapp-icon-60.png", + "sizes": "60x60", + "type": "image/png" + }, + { + "src": "/images/webapp-icon-80.png", + "sizes": "80x80", + "type": "image/png" + }, + { + "src": "/images/webapp-icon-128.png", + "sizes": "128x128", + "type": "image/png" + }, + { + "src": "/images/webapp-icon-256.png", + "sizes": "256x256", + "type": "image/png" + } + ] +} diff --git a/views/index.erb b/views/index.erb index 2e8edf9c..31304e8c 100644 --- a/views/index.erb +++ b/views/index.erb @@ -17,6 +17,7 @@ DevDocs API Documentation + diff --git a/views/other.erb b/views/other.erb index b8dd6d8a..2b24c752 100644 --- a/views/other.erb +++ b/views/other.erb @@ -8,6 +8,7 @@ DevDocs<%= " — #{@doc['full_name']} documentation (fast, offline)" if doc_index_page? %> +