get_url('sitemap.xml'); echo "User-agent: *\n"; echo "Disallow:\n"; echo "Crawl-delay: 5\n"; echo "Disallow: /_comments/\n"; echo "Disallow: /pacbattle/\n"; echo "Disallow: /bucket/\n"; echo "Sitemap: {$sitemap}\n"; } private function sitemap_page(string $url, string $priority): void { echo "\n"; echo "{$this->get_url($url)}\n"; echo "{$priority}\n"; echo ""; } public function sitemap(): void { header("Content-Type: application/xml"); echo "\n"; echo "\n"; $this->sitemap_page('home', 1); $this->sitemap_page('projects', 0.8); $this->sitemap_page('blog', 0.8); $this->load_lang('blog'); $blog_modal = $this->load_model('blog'); $blog = $blog_modal->get_data()['blog']; foreach ($blog as $name => $_) { $name = substr($name, 0, -3); $this->sitemap_page("blog/post/{$name}", 0.5); } echo "\n"; } public function manifest(): void { $json = array( 'short_name' => lang('domain'), 'name' => lang('domain'), 'icons' => [ array( 'src' => $this->get_url('public/icons/logo512.png'), 'type' => 'image/png', 'sizes' => '512x512', 'purpose' => 'any maskable' ) ], 'id' => $this->get_url('home'), 'start_url' => $this->get_url('home'), 'background_color' => lang('theme_color'), 'display' => 'standalone', 'scope' => lang('base_path'), 'theme_color' => lang('theme_color'), 'shortcuts' => [], 'description' => lang('default_short_desc'), 'screenshots' => [] ); header('Content-type: application/json'); echo json_encode($json); } }