Skip to content

Aurora 1.0 is out!

What's new →
Docs menu

Building a site

Layouts and the website

The views that draw whole pages, and everything Aurora serves.

A layout is a Blade view that draws a whole page: <head>, header, the blocks and the footer. Aurora ships four: standard (the default: header, menu and footer), landing (the header floating over the first block), minimal (the logo alone, for campaigns) and blank (the page alone), published to resources/views/vendor/aurora/layouts on install so the site can make them its own. This website adds two of its own: the landing page its homepage uses, and the docs layout you're reading.

resources/views/vendor/aurora/layouts/standard.blade.php Blade
<x-layouts.site
    :title="$page->seoTitle()"
    :description="$page->meta_description ?: $page->excerpt"
    :canonical="$page->url()"
    :noindex="$page->noindex || $page->isRestricted() || $preview || $embedded"
    :page="$embedded ? null : $page"
>
    <x-aurora::blocks :page="$page" />
</x-layouts.site>
  • Every layout gets $page, $layout, $preview (a preview link, or a page that isn't live yet) and $embedded (drawn inside the visual editor's preview).
  • <x-aurora::blocks :page="$page" /> renders the page's blocks in the current language.
  • Adding a layout: in Settings › Templates › Layouts, give it a name, handle, icon and the Blade view it uses, which can be any view in your app, and pick the default. Pages choose their layout from cards with thumbnails, and preview links can show a page in another layout.
  • Shared pieces such as the header, menus and footer belong in components: Menu::location('header'), Setting::get(…), and the settings your blocks' library adds.

What Aurora serves

  • Pages at their address, in the layout they chose, and other languages under their prefix (/nb/om-oss). Drafts and scheduled pages answer 404 to visitors and show as previews to signed-in editors.
  • Signed preview links for drafts, scheduled pages, unpublished changes, revisions, other languages and other layouts.
  • sitemap.xml of live pages, without hidden, password-protected or members-only pages, and robots.txt, which keeps crawlers out of /admin and previews.
  • Password-protected pages unlock for the visit; members-only pages show a sign-in page. Publish aurora-views to restyle them.
  • Redirects, checked before a 404; the page cache; /files/{id}; and forms posted to /forms/{form}.

Turn aurora.routes off to route pages yourself with Aurora\Http\Controllers\PageController.