debian-mirror-gitlab/app/views/pwa/manifest.json.erb

36 lines
996 B
Text
Raw Normal View History

2022-07-23 23:45:48 +05:30
{
2023-04-23 21:23:45 +05:30
"name": "<%= appearance_pwa_name %>",
"short_name": "<%= appearance_pwa_short_name %>",
"description": "<%= appearance_pwa_description %>",
2022-07-23 23:45:48 +05:30
"start_url": "<%= explore_projects_path %>",
"scope": "<%= root_path %>",
"display": "browser",
"orientation": "any",
"background_color": "#fff",
"theme_color": "<%= user_theme_primary_color %>",
2023-04-23 21:23:45 +05:30
"icons": [
<% widths = Appearance::ALLOWED_PWA_ICON_SCALER_WIDTHS %>
<% widths.each do |width| -%>
2022-07-23 23:45:48 +05:30
{
2023-04-23 21:23:45 +05:30
<% if source = appearance_pwa_icon_path_scaled(width) -%>
"src": "<%= source %>",
"sizes": "<%= width.to_s + "x" + width.to_s %>",
2022-07-23 23:45:48 +05:30
"type": "image/png"
2023-04-23 21:23:45 +05:30
<% else -%>
"error": "<%= "#{width} is not an allowed PWA scale" %>"
<% end -%>
}
<% unless width == widths.last -%>
,
<% end -%>
<% end -%>
<% unless current_appearance&.pwa_icon.present? -%>
,{
"src": "<%= appearance_maskable_logo %>",
2022-07-23 23:45:48 +05:30
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
2023-04-23 21:23:45 +05:30
}
<% end -%>]
2022-07-23 23:45:48 +05:30
}