Generate not_found.html

This commit is contained in:
Jordan Goulder 2025-01-12 16:13:12 -05:00
parent 71d6cb9660
commit 222743e60d
5 changed files with 42 additions and 1 deletions

13
not_found.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<link href="/favicon.ico" rel="icon">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Floppy Drive</title>
</head>
<body>
<div id="app"></div>
<script src="/src/main_not_found.ts" type="module"></script>
</body>
</html>

13
src/AppNotFound.vue Normal file
View File

@ -0,0 +1,13 @@
<script lang="ts" setup>
import SiteHeader from '@/components/SiteHeader.vue'
import NotFoundView from '@/components/NotFoundView.vue'
</script>
<template>
<SiteHeader />
<main>
<NotFoundView />
</main>
</template>
<style scoped></style>

View File

@ -4,7 +4,7 @@
<section> <section>
<h2>Page Not Found</h2> <h2>Page Not Found</h2>
<p>I couldn't seem to find that.</p> <p>I couldn't seem to find that.</p>
<p>You should probably just head back <a href="#/">Home</a>.</p> <p>You should probably just head back <a href="/">Home</a>.</p>
</section> </section>
</template> </template>

6
src/main_not_found.ts Normal file
View File

@ -0,0 +1,6 @@
import './assets/main.css'
import { createApp } from 'vue'
import NotFound from '@/AppNotFound.vue'
createApp(NotFound).mount('#app')

View File

@ -1,4 +1,5 @@
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
import { resolve } from 'path'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
@ -12,4 +13,12 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
}, },
}, },
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
notFound: resolve(__dirname, 'not_found.html'),
},
},
},
}) })