running-tools

A collection of tools for runners and their coaches
git clone https://git.ashermorgan.net/running-tools/
Log | Files | Refs | README

commit 632974cc3a691b9823bbb35641bd5e4e5dcdc163
parent 61d0541c51ad0cb782a4170bf27f6a39f3822dff
Author: ashermorgan <59518073+ashermorgan@users.noreply.github.com>
Date:   Thu, 28 Dec 2023 13:48:11 -0800

Build 404.html with Vite so links match base path

Diffstat:
A404.html | 43+++++++++++++++++++++++++++++++++++++++++++
Dpublic/404.html | 44--------------------------------------------
Mvite.config.js | 9+++++++++
3 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/404.html b/404.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#ff8000"> + <link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"> + + <title>404 Not Found - Running Tools</title> + <meta name="description" content="A collection of tools for runners and their coaches that calculate splits, predict race times, convert units, and more"> + + <style> + * { + margin: 0px; + padding: 0px; + box-sizing: border-box; + } + body { + font-family: Segoe UI, sans-serif; + text-align: center; + } + header { + background-color: hsl(30, 100%, 50%); + padding: 0.25em; + font-size: 2em; + font-weight: bold; + } + h1 { + font-size: 1.5em; + margin: 10px 10px 0px; + } + </style> + </head> + + <body> + <header>Running Tools</header> + <main> + <h1>404 Not Found</h1> + <p><a href="%BASE_URL%">homepage</a></p> + </main> + </body> +</html> diff --git a/public/404.html b/public/404.html @@ -1,44 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="description" content="A collection of tools for runners and their coaches that calculate splits, predict race times, convert units, and more"> - <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <title>404 Not Found - Running Tools</title> - - <link rel="icon" type="image/png" sizes="32x32" href="https://ashermorgan.github.io/running-tools/img/icons/favicon-32x32.png"> - <link rel="icon" type="image/png" sizes="16x16" href="https://ashermorgan.github.io/running-tools/img/icons/favicon-16x16.png"> - <link rel="apple-touch-icon" href="https://ashermorgan.github.io/running-tools/img/icons/apple-touch-icon-180x180.png"> - - <style> - * { - margin: 0px; - padding: 0px; - box-sizing: border-box; - } - body { - font-family: Segoe UI, sans-serif; - text-align: center; - } - header { - background-color: hsl(30, 100%, 50%); - padding: 0.25em; - font-size: 2em; - font-weight: bold; - } - h1 { - font-size: 1.5em; - margin: 10px 10px 0px; - } - </style> - </head> - - <body> - <header>Running Tools</header> - <main> - <h1>404 Not Found</h1> - <p><a href="https://ashermorgan.github.io/running-tools">homepage</a></p> - </main> - </body> -</html> diff --git a/vite.config.js b/vite.config.js @@ -1,10 +1,19 @@ import { fileURLToPath, URL } from 'node:url'; +import { resolve } from 'path'; import { defineConfig } from 'vite'; import { VitePWA } from 'vite-plugin-pwa'; import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ + build: { + rollupOptions: { + input: { + index: resolve(__dirname, 'index.html'), + not_found: resolve(__dirname, '404.html'), + }, + }, + }, plugins: [ vue(), VitePWA({