2021-11-24 22:45:05 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Web.ManifestView do
|
|
|
|
use Pleroma.Web, :view
|
|
|
|
alias Pleroma.Config
|
|
|
|
alias Pleroma.Web.Endpoint
|
|
|
|
|
|
|
|
def render("manifest.json", _params) do
|
|
|
|
%{
|
|
|
|
name: Config.get([:instance, :name]),
|
|
|
|
description: Config.get([:instance, :description]),
|
2022-11-28 22:44:20 +00:00
|
|
|
icons: [
|
|
|
|
%{
|
2022-12-03 23:17:43 +00:00
|
|
|
src: "/static/logo.svg",
|
|
|
|
type: "image/svg+xml"
|
2022-11-28 22:44:20 +00:00
|
|
|
},
|
|
|
|
%{
|
2022-12-03 23:17:43 +00:00
|
|
|
src: "/static/logo-512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png",
|
|
|
|
purpose: "maskable"
|
2022-12-07 11:41:24 +00:00
|
|
|
},
|
|
|
|
%{
|
|
|
|
src: "/static/logo-512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png"
|
2022-11-28 22:44:20 +00:00
|
|
|
}
|
|
|
|
],
|
2021-11-24 22:45:05 +00:00
|
|
|
theme_color: Config.get([:manifest, :theme_color]),
|
|
|
|
background_color: Config.get([:manifest, :background_color]),
|
|
|
|
display: "standalone",
|
|
|
|
scope: Endpoint.url(),
|
|
|
|
start_url: "/",
|
|
|
|
categories: [
|
|
|
|
"social"
|
|
|
|
],
|
|
|
|
serviceworker: %{
|
2022-11-28 22:44:20 +00:00
|
|
|
src: "/sw-pleroma.js"
|
2021-11-24 22:45:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|