Add page publication history and reusable blocks
This commit is contained in:
@@ -38,7 +38,7 @@ final class SiteController
|
||||
public function page(Request $request, string $slug): Response
|
||||
{
|
||||
$repo = new Repository();
|
||||
$page = $repo->page($slug);
|
||||
$page = $repo->publishedPage($slug);
|
||||
if (!$page || $page['layout_kind'] !== null || !in_array($page['page_type'], ['page', 'home'], true)
|
||||
|| $page['status'] !== 'published') {
|
||||
return $this->missing($request);
|
||||
@@ -238,7 +238,7 @@ final class SiteController
|
||||
$entry = preg_match('~^/(?:admin|account)(?:/|$)~D', $normal)
|
||||
&& Route::dispatch($request->method(), $normal)[0] === Dispatcher::FOUND;
|
||||
$single = preg_match('~^/[a-z0-9]+(?:-[a-z0-9]+)*$~D', $normal);
|
||||
$page = $single ? (new Repository())->page(substr($normal, 1)) : null;
|
||||
$page = $single ? (new Repository())->publishedPage(substr($normal, 1)) : null;
|
||||
if ($entry || ($page && $page['layout_kind'] === null && in_array($page['page_type'], ['page', 'home'], true) && $page['status'] === 'published')
|
||||
|| preg_match('~^/articles(?:/[a-z0-9-]+){1,2}$~D', $normal)) {
|
||||
$query = $request->queryString();
|
||||
|
||||
Reference in New Issue
Block a user