Skip to content

Commit 587c403

Browse files
lucasfernogrstoenescu
authored andcommitted
feat(docs) not found page (quasarframework#4526)
1 parent 0fc5aeb commit 587c403

File tree

3 files changed

+58
-14
lines changed

3 files changed

+58
-14
lines changed

docs/src-ssr/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ app.get('*', (req, res) => {
5757
res.redirect(err.url)
5858
}
5959
else if (err.code === 404) {
60-
res.status(404).send('404 | Page Not Found')
60+
res.redirect('/not-found')
6161
}
6262
else {
6363
// Render Error Page or Redirect

docs/src/pages/Error404.vue

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,56 @@
11
<template lang="pug">
22
.fixed-center.text-center.text-white
33
p
4-
img(src='~assets/sad.svg', style='width:30vw;max-width:150px;')
5-
p.text-grey
4+
img(src='statics/quasar-logo.png', style='width:30vw;max-width:150px;')
5+
p.text-grey-7
66
| Sorry, nothing here...
77
strong (404)
8-
q-btn(
9-
color='primary'
10-
style='width:200px;'
11-
to="/"
12-
) Homepage
8+
div.menus-container
9+
q-btn(
10+
color='primary'
11+
style='width:200px;'
12+
to="/"
13+
) Homepage
14+
q-btn(
15+
color='primary'
16+
style='width:200px;'
17+
to="/quasar-cli"
18+
) Quasar CLI
19+
q-btn(
20+
color='primary'
21+
style='width:200px;'
22+
to="/style"
23+
) Style
24+
q-btn(
25+
color='primary'
26+
style='width:200px;'
27+
to="/layout"
28+
) Layout
29+
q-btn(
30+
color='primary'
31+
style='width:200px;'
32+
to="/vue-components"
33+
) Vue Components
34+
q-btn(
35+
color='primary'
36+
style='width:200px;'
37+
to="/vue-directives"
38+
) Vue Directives
39+
q-btn(
40+
color='primary'
41+
style='width:200px;'
42+
to="/quasar-plugins"
43+
) Quasar Plugins
44+
q-btn(
45+
color='primary'
46+
style='width:200px;'
47+
to="/app-extensions"
48+
) App Extensions
49+
q-btn(
50+
color='primary'
51+
style='width:200px;'
52+
to="/quasar-utils"
53+
) Quasar Utils
1354
</template>
1455

1556
<script>
@@ -21,3 +62,8 @@ export default {
2162
}
2263
}
2364
</script>
65+
66+
<style lang="stylus">
67+
.menus-container a
68+
margin 4px
69+
</style>

docs/src/router/routes.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ const routes = [
9494
]
9595

9696
// Always leave this as last one
97-
if (process.env.MODE !== 'ssr') {
98-
routes.push({
99-
path: '*',
100-
component: () => import('pages/Error404.vue')
101-
})
102-
}
97+
routes.push({
98+
path: process.env.MODE === 'ssr' ? '/not-found' : '*',
99+
component: () => import('pages/Error404.vue')
100+
})
103101

104102
export default routes

0 commit comments

Comments
 (0)