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 { $domain = CONFIG['domain']; $theme_color = CONFIG['theme_color']; $json = array( 'short_name' => $domain, 'name' => $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' => $theme_color, 'display' => 'standalone', 'scope' => CONFIG['base_path'], 'theme_color' => $theme_color, 'shortcuts' => [], 'description' => lang('default_short_desc'), 'screenshots' => [] ); header('Content-type: application/json'); echo json_encode($json); } }