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'); + } } diff --git a/config/app.php b/config/app.php index fad0c20f2..ca30ee2a0 100755 --- a/config/app.php +++ b/config/app.php @@ -4,12 +4,28 @@ return [ 'env' => env('APP_ENV', 'production'), + /** + * Set the default view type for various lists. Can be overridden by user preferences. + * This will be used for public viewers and users that have not set a preference. + */ 'views' => [ 'books' => env('APP_VIEWS_BOOKS', 'list') ], + /** + * Allow