Skip to content

Commit

Permalink
Error page done (#452)
Browse files Browse the repository at this point in the history
* Error page done

* 🐛 (page) update template location to avoid overwriting docus error page

Co-authored-by: Yaël GUILLOUX <yael.guilloux@gmail.com>
  • Loading branch information
R-mooon and Tahul committed Jun 17, 2021
1 parent 9c0377c commit 58b2b95
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions nuxtjs.org/components/templates/Error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<AppPage class="min-h-screen-sm">
<div class="mt-48 flex items-center justify-center flex-col px-4 md:px-0">
<h1 class="font-serif text-display-6 md:text-display-5 2xl:text-display-4 text-center">{{ error.message }}</h1>
<p class="text-center mt-4 mb-4">We couldn't find the page you are looking for.</p>
<SectionButton to="/" size="md" class="bg-primary text-gray-800 hover:bg-green-300 focus:bg-green-300">
Go back home
</SectionButton>
</div>
</AppPage>
</template>

<script>
import { defineComponent } from '@nuxtjs/composition-api'
export default defineComponent({
props: {
error: {
type: Object,
required: true
}
},
head() {
return {
title: this.error.message
}
},
templateOptions: {
aside: false,
fluid: false
}
})
</script>
2 changes: 1 addition & 1 deletion src/app/pages/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineComponent({
.fetch()
// Break on missing page query
if (!page) return error({ statusCode: 404, message: 'Page not found' })
if (!page) return error({ statusCode: 404, message: '404 - Page not found' })
// Get page template
page.template = $docus.getPageTemplate(page)
Expand Down

1 comment on commit 58b2b95

@vercel
Copy link

@vercel vercel bot commented on 58b2b95 Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.