mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 02:36:42 +02:00
feat(settings): add general config for instance (site name, description and icon)
This commit is contained in:
parent
193b373bc9
commit
5c56f3e6f0
41 changed files with 533 additions and 52 deletions
45
app/Controllers/WebmanifestController.php
Normal file
45
app/Controllers/WebmanifestController.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue