- $sidebarTree = $this->bookRepo->getChildren($book);
- $pageNav = $this->pageRepo->getPageNav($page);
-
+ $page->html = $this->entityRepo->renderPage($page);
+ $sidebarTree = $this->entityRepo->getBookChildren($page->book);
+ $pageNav = $this->entityRepo->getPageNav($page->html);
+
+ // check if the comment's are enabled
+ $commentsEnabled = !setting('app-disable-comments');
+ if ($commentsEnabled) {
+ $page->load(['comments.createdBy']);
+ }
+