Skip to content

Commit c7d1947

Browse files
committed
switch to default nuxt routing
1 parent 4c8634c commit c7d1947

13 files changed

+119
-123
lines changed

layouts/BlogLayout.vue

-9
This file was deleted.
File renamed without changes.

nuxt.config.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@ export default defineNuxtConfig({
1616
APP_MODE: process.env?.NODE_ENV,
1717
},
1818
},
19-
hooks: {
20-
'pages:routerOptions'({ files }) {
21-
files.push({
22-
path: path.resolve('./router.options'),
23-
optional: true,
24-
});
25-
},
26-
},
2719
app: {
2820
head: {
21+
charset: 'utf-8',
22+
viewport: 'width=device-width, initial-scale=1',
2923
link: [],
3024
},
3125
},

pages/ErrorView.vue

-32
This file was deleted.

pages/ProjectsView.vue

-7
This file was deleted.

pages/[...slug].vue

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script lang="ts" setup>
2+
import type { NuxtError } from '#app';
3+
4+
defineProps({
5+
// eslint-disable-next-line vue/require-default-prop
6+
error: Object as () => NuxtError,
7+
});
8+
9+
const handleError = () => clearError({ redirect: '/' });
10+
</script>
11+
12+
<template>
13+
<main
14+
class="grid min-h-full place-items-center bg-white px-6 py-24 sm:py-32 lg:px-8"
15+
>
16+
<div class="text-center">
17+
<h1
18+
class="mt-4 text-5xl uppercase font-bold tracking-tight text-gray-900 sm:text-5xl"
19+
>
20+
{{ 'Not Found' }}
21+
</h1>
22+
<p class="mt-6 text-base leading-7 text-gray-600">
23+
Sorry, we couldn’t find the page you’re looking for.
24+
</p>
25+
<div class="mt-10 flex items-center justify-center gap-x-6">
26+
<Button
27+
type="button"
28+
class="rounded-md px-4 py-4 text-md font-semibold text-white shadow-sm hover:bg-blue-600"
29+
@click="() => handleError()"
30+
>Go Back</Button
31+
>
32+
</div>
33+
</div>
34+
</main>
35+
</template>

pages/blog/ArticleSearch.vue

-16
This file was deleted.

pages/blog/ArticleRender.vue renamed to pages/blog/[...slug].vue

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ const { data: page } = await useAsyncData(() =>
1010
.findOne(),
1111
);
1212
const pagePath = computed<string>(() => page.value?._path ?? '');
13+
14+
if (page.value !== null) {
15+
useSeoMeta({
16+
title: page.value.title + ' :: Godwin Peter .O',
17+
ogTitle: page.value.title,
18+
description: page.value.description,
19+
ogDescription: page.value.description,
20+
ogImage: page.value.image,
21+
twitterCard: 'summary_large_image',
22+
});
23+
}
1324
</script>
1425

1526
<template>

pages/blog/ArticleList.vue renamed to pages/blog/index.vue

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,26 @@ const { data: articles } = await useAsyncData(() =>
1212
.sort({ date: -1 })
1313
.find(),
1414
);
15+
16+
const pageHeading = ref("Peter's Random Musings");
17+
const pageTitle = ref('Blog :: Godwin Peter .O');
18+
const pageDescription = ref('List of articles in the blog');
19+
20+
useSeoMeta({
21+
title: pageTitle.value,
22+
description: pageDescription.value,
23+
ogTitle: pageHeading.value,
24+
ogDescription: pageDescription.value,
25+
ogImage: 'https://godwin.dev//images/placeholder.webp',
26+
twitterCard: 'summary_large_image',
27+
});
1528
</script>
1629

1730
<template>
1831
<div class="mt-8">
1932
<div class="text-center">
2033
<div class="text-5xl text-blue-500 font-bold mb-3">
21-
{{ "Peter's Random Musings" }}
34+
{{ pageHeading }}
2235
</div>
2336
<p class="font-sans text-base font-light xl:w-2/4 lg:w-3/4 mx-auto">
2437
{{ "Here's a list of all my blog posts" }}

pages/blog/search.vue

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script lang="ts" setup>
2+
// const search = ref('');
3+
// const results = searchContent(search);
4+
5+
const pageHeading = ref('Search blog');
6+
const pageTitle = ref('Search');
7+
const pageDescription = ref('List of filtered articles');
8+
9+
useSeoMeta({
10+
title: pageTitle.value + ' :: Godwin Peter .O',
11+
description: pageDescription.value,
12+
ogTitle: pageHeading.value,
13+
ogDescription: pageDescription.value,
14+
ogImage: 'https://godwin.dev//images/placeholder.webp',
15+
twitterCard: 'summary_large_image',
16+
});
17+
</script>
18+
19+
<template>
20+
<div>
21+
<!-- <InputText v-model="search" type="text" />
22+
23+
<pre>{{ results }} </pre> -->
24+
</div>
25+
</template>

pages/HomeView.vue renamed to pages/index.vue

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
<script lang="ts" setup></script>
1+
<script lang="ts" setup>
2+
const pageHeading = ref('Godwin Peter .O personal website');
3+
const pageTitle = ref('Home :: Godwin Peter .O');
4+
const pageDescription = ref('Profile home page for Godwin Peter .O');
5+
6+
useSeoMeta({
7+
title: pageTitle.value,
8+
description: pageDescription.value,
9+
ogTitle: pageHeading.value,
10+
ogDescription: pageDescription.value,
11+
twitterCard: 'summary_large_image',
12+
});
13+
</script>
214

315
<template>
416
<div>

pages/projects.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script lang="ts" setup>
2+
const pageHeading = ref('Godwin Peter .O projects');
3+
const pageTitle = ref('Projects :: Godwin Peter .O');
4+
const pageDescription = ref('Projects for Godwin Peter .O');
5+
6+
useSeoMeta({
7+
title: pageTitle.value,
8+
description: pageDescription.value,
9+
ogTitle: pageHeading.value,
10+
ogDescription: pageDescription.value,
11+
twitterCard: 'summary_large_image',
12+
});
13+
</script>
14+
15+
<template>
16+
<div></div>
17+
</template>
18+
19+
<style></style>

router.options.ts

-49
This file was deleted.

0 commit comments

Comments
 (0)