From da06ae127926f303cd6837ef0c2c9e4a445960a6 Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Tue, 14 Apr 2026 22:19:26 +0100 Subject: [PATCH] more post support --- package.json | 3 +- pnpm-lock.yaml | 55 +++++++++++++++++++++++++++ src/lib/Layout.svelte | 12 ++++++ src/lib/PostHelpers.svelte | 16 ++++++++ src/lib/md_layout.svelte | 8 ---- src/lib/web_buttons/webButtons.svelte | 3 +- src/routes/+layout.svelte | 3 ++ static/shared.css | 15 -------- svelte.config.js => svelte.config.ts | 33 +++++++++------- tsconfig.json | 8 +++- vite.config.ts | 11 +++++- 11 files changed, 124 insertions(+), 43 deletions(-) create mode 100644 src/lib/Layout.svelte create mode 100644 src/lib/PostHelpers.svelte delete mode 100644 src/lib/md_layout.svelte rename svelte.config.js => svelte.config.ts (90%) diff --git a/package.json b/package.json index 6ceee76..0082adf 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "svelte": "^5.55.3", "svelte-check": "^4.4.6", "typescript": "^5.9.3", - "vite": "^7.3.2" + "vite": "^7.3.2", + "vite-tsconfig-paths": "^6.1.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d38ee60..1984e4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ importers: vite: specifier: ^7.3.2 version: 7.3.2(@types/node@25.6.0)(sass@1.99.0) + vite-tsconfig-paths: + specifier: ^6.1.1 + version: 6.1.1(typescript@5.9.3)(vite@7.3.2(@types/node@25.6.0)(sass@1.99.0)) packages: @@ -716,6 +719,15 @@ packages: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -760,6 +772,9 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + imagetools-core@9.1.0: resolution: {integrity: sha512-xQjs+2vrxLnAjCq+omuNkd5UQTld9/bP8+YT0LyYTlKfuSQtgUBvqhUwGugzSAh6sCdN+LnROMuLswn5hZ9Fhg==} engines: {node: '>=20.0.0'} @@ -801,6 +816,9 @@ packages: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} engines: {node: '>=10'} + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -904,6 +922,16 @@ packages: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} + tsconfck@3.1.6: + resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} + engines: {node: ^18 || >=20} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -934,6 +962,11 @@ packages: resolution: {integrity: sha512-FwjApRNZyN+RucPW9Z9kf0dyzyi3r3zlDfrTnzHXNaYpmT3pZ5w//d6QkApy1iypbDm+3fq+Gwfv+PYA4j4uYw==} engines: {node: '>=20.0.0'} + vite-tsconfig-paths@6.1.1: + resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==} + peerDependencies: + vite: '*' + vite@7.3.2: resolution: {integrity: sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1425,6 +1458,10 @@ snapshots: cookie@0.6.0: {} + debug@4.4.3: + dependencies: + ms: 2.1.3 + deepmerge@4.3.1: {} detect-libc@2.1.2: {} @@ -1477,6 +1514,8 @@ snapshots: fsevents@2.3.3: optional: true + globrex@0.1.2: {} + imagetools-core@9.1.0: {} immutable@5.1.5: @@ -1516,6 +1555,8 @@ snapshots: mrmime@2.0.1: {} + ms@2.1.3: {} + nanoid@3.3.11: {} node-addon-api@7.1.1: @@ -1677,6 +1718,10 @@ snapshots: totalist@3.0.1: {} + tsconfck@3.1.6(typescript@5.9.3): + optionalDependencies: + typescript: 5.9.3 + tslib@2.8.1: optional: true @@ -1715,6 +1760,16 @@ snapshots: transitivePeerDependencies: - rollup + vite-tsconfig-paths@6.1.1(typescript@5.9.3)(vite@7.3.2(@types/node@25.6.0)(sass@1.99.0)): + dependencies: + debug: 4.4.3 + globrex: 0.1.2 + tsconfck: 3.1.6(typescript@5.9.3) + vite: 7.3.2(@types/node@25.6.0)(sass@1.99.0) + transitivePeerDependencies: + - supports-color + - typescript + vite@7.3.2(@types/node@25.6.0)(sass@1.99.0): dependencies: esbuild: 0.27.7 diff --git a/src/lib/Layout.svelte b/src/lib/Layout.svelte new file mode 100644 index 0000000..80fcb84 --- /dev/null +++ b/src/lib/Layout.svelte @@ -0,0 +1,12 @@ + + + + +

meow

+{@render props.children?.()} + + diff --git a/src/lib/PostHelpers.svelte b/src/lib/PostHelpers.svelte new file mode 100644 index 0000000..1b69ec7 --- /dev/null +++ b/src/lib/PostHelpers.svelte @@ -0,0 +1,16 @@ + diff --git a/src/lib/md_layout.svelte b/src/lib/md_layout.svelte deleted file mode 100644 index 3f92de4..0000000 --- a/src/lib/md_layout.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -
© 2026 My Site
diff --git a/src/lib/web_buttons/webButtons.svelte b/src/lib/web_buttons/webButtons.svelte index ead44a2..1a33d0e 100644 --- a/src/lib/web_buttons/webButtons.svelte +++ b/src/lib/web_buttons/webButtons.svelte @@ -1,13 +1,12 @@ diff --git a/static/shared.css b/static/shared.css index b3bd852..94bf06e 100644 --- a/static/shared.css +++ b/static/shared.css @@ -8,21 +8,6 @@ --accent-2: #66232e; --accent-3: #44131a; } - nav { - width: 100%; - height: 32px; - background-color: var(--accent-2); - border: 3px, outset, var(--accent-3); - align-content: center; - font-size: 18px; - a { - padding: 5px; - color: #9f8083; - } - a:hover { - color: #043b2f; - } - } body { background-image: url("/bg.png"); margin: 40px auto; diff --git a/svelte.config.js b/svelte.config.ts similarity index 90% rename from svelte.config.js rename to svelte.config.ts index 95a9777..39cb1e1 100644 --- a/svelte.config.js +++ b/svelte.config.ts @@ -4,7 +4,26 @@ import { mdsvex } from "mdsvex"; /** @type {import('@sveltejs/kit').Config} */ const config = { extensions: [".svelte", ".md"], + preprocess: [ + mdsvex({ + // The default mdsvex extension is .svx; this overrides that. + extensions: [".md"], + + layout: { + _: 'src/lib/Layout.svelte', + }, + + // Adds IDs to headings, and anchor links to those IDs. Note: must stay in this order to work. + rehypePlugins: [ + // rehypeSlug, + // rehypeAutolinkHeadings, + ], + }), + ], kit: { + alias: { + 'src': './src/', + }, files: { assets: "./static", }, @@ -18,20 +37,6 @@ const config = { strict: true }), }, - preprocess: [ - mdsvex({ - // The default mdsvex extension is .svx; this overrides that. - extensions: [".md"], - - layout: "$lib/md_layout.svelte", - - // Adds IDs to headings, and anchor links to those IDs. Note: must stay in this order to work. - rehypePlugins: [ - // rehypeSlug, - // rehypeAutolinkHeadings, - ], - }), - ], }; export default config; diff --git a/tsconfig.json b/tsconfig.json index c7b9df5..994214e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,11 @@ "compilerOptions": { "rewriteRelativeImportExtensions": true, "allowJs": true, + // "baseUrl": ".", + // "paths": { + // "$app/*": [".svelte/dev/runtime/app/*", ".svelte/build/runtime/app/*"], + // "$lib/*": ["src/lib/*"] + // }, "checkJs": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, @@ -11,7 +16,8 @@ "sourceMap": true, "strict": true, "moduleResolution": "bundler" - } + }, + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files // diff --git a/vite.config.ts b/vite.config.ts index cddb275..15ad958 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,16 @@ import { sveltekit } from "@sveltejs/kit/vite"; import { defineConfig } from "vite"; import { enhancedImages } from '@sveltejs/enhanced-img'; +import tsconfigPaths from 'vite-tsconfig-paths' export default defineConfig({ // publicDir: "./meowmeowmeow", - plugins: [enhancedImages(), sveltekit(), - ], + plugins: [enhancedImages(), sveltekit(), tsconfigPaths()], + build: { + }, + resolve: { + alias: { + 'src': './src/', + } + }, });