feat(settings): add general config for instance (site name, description and icon)

This commit is contained in:
Yassine Doghri 2021-10-26 15:54:56 +00:00
commit 5c56f3e6f0
41 changed files with 533 additions and 52 deletions

View file

@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\ResponseInterface;
class WebmanifestController extends Controller
{
public function index(): ResponseInterface
{
$webmanifest = [
'name' => service('settings')
->get('App.siteName'),
'description' => service('settings')
->get('App.siteDescription'),
'display' => 'minimal-ui',
'theme_color' => '#009486',
'icons' => [
[
'src' => service('settings')
->get('App.siteIcon')['192'],
'type' => 'image/png',
'sizes' => '192x192',
],
[
'src' => service('settings')
->get('App.siteIcon')['512'],
'type' => 'image/png',
'sizes' => '512x512',
],
],
];
return $this->response->setJSON($webmanifest);
}
}