<?php

$name = laniakea_option('manifest_name', 'Laniakea');
$short_name = laniakea_option('manifest_short_name', 'Laniakea');
$description = laniakea_option('manifest_description', 'Laniakea Wordpress Theme');
$start_url = laniakea_option('manifest_start_url', '/index.php');
$color = laniakea_option('manifest_color', '#000000');

$manifest = [
    "name" => $name,
    "short_name" => $short_name,
    "description" => $description,
    "id" => $start_url,
    "start_url" => $start_url,
    "display" => "standalone",
    "orientation" => "portrait",
    "background_color" => $color,
    "theme_color" => $color,
    "icons" => [
        [
            "src" => esc_url(home_url()) . "/icon-192.png",
            "sizes" => "192x192",
            "type" => "image/png",
            "purpose" => "maskable"
        ],
        [
            "src" => esc_url(home_url()) . "/icon-512.png",
            "sizes" => "512x512",
            "type" => "image/png"
        ]
    ]
];

header('Content-Type: application/json');
echo json_encode($manifest);
