check()) { return redirect()->route('dashboard'); } return view('home', [ 'hasOwner' => User::query()->exists(), ]); } public function selfHosting(): View { return view('self-hosting'); } /** * Allow/Disallow use paths, not absolute URLs, per the robots.txt spec. * Only the Sitemap directive takes an absolute URL, generated from this * instance's own domain so every self-hosted BloomFeed gets it for free. */ public function robots(): Response { $lines = [ 'User-agent: *', 'Allow: /', 'Allow: /self-hosting', 'Disallow: /login', 'Disallow: /register', 'Disallow: /dashboard', 'Disallow: /feeds', 'Disallow: /catalog', 'Disallow: /notifiers', 'Disallow: /settings', 'Disallow: /articles', '', 'Sitemap: '.route('sitemap'), ]; return response(implode("\n", $lines), 200)->header('Content-Type', 'text/plain'); } public function sitemap(): Response { $urls = [ ['loc' => route('home'), 'priority' => '1.0'], ['loc' => route('self-hosting'), 'priority' => '0.8'], ]; $xml = ''."\n"; $xml .= ''."\n"; foreach ($urls as $url) { $xml .= " \n"; $xml .= ' '.e($url['loc'])."\n"; $xml .= ' '.$url['priority']."\n"; $xml .= " \n"; } $xml .= ''; return response($xml, 200)->header('Content-Type', 'application/xml'); } }