X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c7a2d568bf693add30c8402d68d1f46f09a44c5b..refs/pull/2513/head:/app/Http/Controllers/HomeController.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index fb3ba8e85..3258f4369 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,9 +1,9 @@ where('draft', '=', true) ->where('created_by', '=', user()->id) ->orderBy('updated_at', 'desc') + ->with('book') ->take(6) ->get(); } @@ -33,8 +34,11 @@ class HomeController extends Controller $recents = $this->isSignedIn() ? Views::getUserRecentlyViewed(12*$recentFactor, 1) : Book::visible()->orderBy('created_at', 'desc')->take(12 * $recentFactor)->get(); - $recentlyUpdatedPages = Page::visible()->where('draft', false) - ->orderBy('updated_at', 'desc')->take(12)->get(); + $recentlyUpdatedPages = Page::visible()->with('book') + ->where('draft', false) + ->orderBy('updated_at', 'desc') + ->take(12) + ->get(); $homepageOptions = ['default', 'books', 'bookshelves', 'page']; $homepageOption = setting('app-homepage-type', 'default'); @@ -106,15 +110,16 @@ class HomeController extends Controller /** * 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('common.robots', ['allowRobots' => $allowRobots]) ->header('Content-Type', 'text/plain');