namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Renderer;
+use Friendica\Core;
use Friendica\DI;
class Manifest extends BaseModule
{
$config = DI::config();
- $tpl = Renderer::getMarkupTemplate('manifest.tpl');
-
header('Content-type: application/manifest+json');
- $touch_icon = $config->get('system', 'touch_icon', 'images/friendica-128.png');
- if ($touch_icon == '') {
- $touch_icon = 'images/friendica-128.png';
- }
+ $touch_icon = $config->get('system', 'touch_icon') ?: 'images/friendica-128.png';
+
+ $theme = DI::config()->get('system', 'theme');
- $output = Renderer::replaceMacros($tpl, [
- '$touch_icon' => $touch_icon,
- '$title' => $config->get('config', 'sitename', 'Friendica'),
+ $tpl = Core\Renderer::getMarkupTemplate('manifest.tpl');
+ $output = Core\Renderer::replaceMacros($tpl, [
+ '$touch_icon' => $touch_icon,
+ '$title' => $config->get('config', 'sitename', 'Friendica'),
+ '$description' => $config->get('config', 'info', DI::l10n()->t('A Decentralized Social Network')),
+ '$background_color' => Core\Theme::getBackgroundColor($theme),
+ '$theme_color' => Core\Theme::getThemeColor($theme),
]);
echo $output;
"name": "{{$title}}",
"start_url": "{{$baseurl}}",
"display": "standalone",
- "description": "A Decentralized Social Network",
+ "description": "{{$description}}",
+{{if $background_color}}
+ "theme_color": "{{$theme_color}}",
+{{/if}}
+{{if $background_color}}
+ "background_color": "{{$background_color}}",
+{{/if}}
+ "short_name": "Friendica",
"icons": [{
- "src": "{{$baseurl}}/{{$touch_icon}}"
+ "src": "{{$baseurl}}/{{$touch_icon}}",
+ "sizes": "128x128",
+ "type": "image/png"
}]
-}
+}
\ No newline at end of file