404

Whenever a 404 error hits, Peak will use the content of an actual 404 entry. This includes SEO data like no-index and the page title. This way you can use the full page builder to style (and localize) your 404 page.

By default Peak ships with an entry in the pages collection called Page not found. In the configuration global you can configure another entry.

There is an ErrorPage class imported from the SEO Addon in the app/Providers/AppServiceProvider.php that takes the data from your 404 entry and renders it using the 404 template when a 404 error triggers. Thanks Jason Varga for this!

SSG

When you use the Statamic Static Site Generator, you'll might notice that all your page titles show 'Page not found'. To remedy this, you need to comment out:

  • ErrorPage::handle404AsEntry() in your app/Providers/AppServiceProvider.php and
  • { partial:statamic-peak-seo::errors/entry_content } in your 404.antlers.html files.

Then use the native statamic wayopen in new window to handle 404 errors.