X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/81fa0210834a8018c2afe0da8c23949ee7cc0aae..refs/pull/768/head:/app/Http/Controllers/HomeController.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3a5fd2cb5..bbe1a8679 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -118,4 +118,20 @@ class HomeController extends Controller { return view('partials/custom-head-content'); } + + /** + * Show the view for /robots.txt + * @return $this + */ + public function getRobots() + { + $sitePublic = setting('app-public', false); + $allowRobots = config('app.allow_robots'); + if ($allowRobots === null) { + $allowRobots = $sitePublic; + } + return response() + ->view('robots', ['allowRobots' => $allowRobots]) + ->header('Content-Type', 'text/plain'); + } }