diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index ad20cef..cae5ea5 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -1,8 +1,20 @@ + + About +

+ Version: + + {version} + +

+ +

Background

Foreground

Muted

diff --git a/svelte.config.js b/svelte.config.js index 42f2953..1204dd7 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,10 @@ import adapter from '@sveltejs/adapter-auto'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; -import path from "path"; +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; + +const path = fileURLToPath(new URL('package.json', import.meta.url)); +const pkg = JSON.parse(readFileSync(path, 'utf8')); /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -13,6 +17,9 @@ const config = { // If your environment is not supported or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. adapter: adapter(), + version: { + name: pkg.version + } } };