diff --git a/bun.lockb b/bun.lockb old mode 100644 new mode 100755 index 32dc027..3a1c38b Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 5f8f816..ce97c46 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "@inlang/paraglide-sveltekit": "0.10.2", "bits-ui": "^0.21.10", "clsx": "^2.1.1", - "lucide-svelte": "^0.395.0", + "lucide-svelte": "^0.396.0", + "mdsvex": "^0.11.2", "mode-watcher": "^0.3.0", "tailwind-merge": "^2.3.0", "tailwind-variants": "^0.2.1" diff --git a/src/lib/components/LanguageSwitcher.svelte b/src/lib/components/LanguageSwitcher.svelte index 2f4611d..1d78d7e 100644 --- a/src/lib/components/LanguageSwitcher.svelte +++ b/src/lib/components/LanguageSwitcher.svelte @@ -18,7 +18,6 @@ // Only remove the language tag if it is present let currentPathNoLang = currentPath.replace(/\/(en|dk)/, ''); let newRouteWithLang = i18n.resolveRoute(currentPathNoLang, tag); - console.log(newRouteWithLang); if (newRouteWithLang !== window.location.pathname) { goto(newRouteWithLang); } diff --git a/src/lib/components/ui/dialog/dialog-content.svelte b/src/lib/components/ui/dialog/dialog-content.svelte new file mode 100644 index 0000000..9512ba8 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-content.svelte @@ -0,0 +1,36 @@ + + + + + + + + + Close + + + diff --git a/src/lib/components/ui/dialog/dialog-description.svelte b/src/lib/components/ui/dialog/dialog-description.svelte new file mode 100644 index 0000000..e1d796a --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-description.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/dialog/dialog-footer.svelte b/src/lib/components/ui/dialog/dialog-footer.svelte new file mode 100644 index 0000000..a235d1f --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-footer.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/src/lib/components/ui/dialog/dialog-header.svelte b/src/lib/components/ui/dialog/dialog-header.svelte new file mode 100644 index 0000000..6b4448c --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/src/lib/components/ui/dialog/dialog-overlay.svelte b/src/lib/components/ui/dialog/dialog-overlay.svelte new file mode 100644 index 0000000..3721361 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-overlay.svelte @@ -0,0 +1,21 @@ + + + diff --git a/src/lib/components/ui/dialog/dialog-portal.svelte b/src/lib/components/ui/dialog/dialog-portal.svelte new file mode 100644 index 0000000..eb5d0a5 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-portal.svelte @@ -0,0 +1,8 @@ + + + + + diff --git a/src/lib/components/ui/dialog/dialog-title.svelte b/src/lib/components/ui/dialog/dialog-title.svelte new file mode 100644 index 0000000..06574f3 --- /dev/null +++ b/src/lib/components/ui/dialog/dialog-title.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/dialog/index.ts b/src/lib/components/ui/dialog/index.ts new file mode 100644 index 0000000..b17ba5e --- /dev/null +++ b/src/lib/components/ui/dialog/index.ts @@ -0,0 +1,37 @@ +import { Dialog as DialogPrimitive } from "bits-ui"; + +import Title from "./dialog-title.svelte"; +import Portal from "./dialog-portal.svelte"; +import Footer from "./dialog-footer.svelte"; +import Header from "./dialog-header.svelte"; +import Overlay from "./dialog-overlay.svelte"; +import Content from "./dialog-content.svelte"; +import Description from "./dialog-description.svelte"; + +const Root = DialogPrimitive.Root; +const Trigger = DialogPrimitive.Trigger; +const Close = DialogPrimitive.Close; + +export { + Root, + Title, + Portal, + Footer, + Header, + Trigger, + Overlay, + Content, + Description, + Close, + // + Root as Dialog, + Title as DialogTitle, + Portal as DialogPortal, + Footer as DialogFooter, + Header as DialogHeader, + Trigger as DialogTrigger, + Overlay as DialogOverlay, + Content as DialogContent, + Description as DialogDescription, + Close as DialogClose, +}; diff --git a/src/lib/projects/nbskak_dk.md b/src/lib/projects/nbskak_dk.md new file mode 100644 index 0000000..126747a --- /dev/null +++ b/src/lib/projects/nbskak_dk.md @@ -0,0 +1,10 @@ +--- +title: Nørrebro Skakklub +image: https://nbskak.dk/card.webp +tags: react +people: jonathan, elliott, johannes +short_description: hejhejhej +--- + +# Nørrebro skakklub +længere description arh \ No newline at end of file diff --git a/src/lib/projects/nbskak_en.md b/src/lib/projects/nbskak_en.md new file mode 100644 index 0000000..b18e768 --- /dev/null +++ b/src/lib/projects/nbskak_en.md @@ -0,0 +1,10 @@ +--- +title: Nørrebro chessclub +image: https://nbskak.dk/card.webp +tags: react +people: jonathan, elliott, johannes +short_description: heyheyhey +--- + +# Nørrebro skakklub +lAUHDUAIDH \ No newline at end of file diff --git a/src/routes/projects/+layout.svelte b/src/routes/projects/+layout.svelte new file mode 100644 index 0000000..e7cf7b2 --- /dev/null +++ b/src/routes/projects/+layout.svelte @@ -0,0 +1,39 @@ + + +
+

Our projects:

+ +

Nørrebro Skakklubs website

+
+ + NBskak + +
+ +
+ + + + + + \ No newline at end of file diff --git a/src/routes/projects/+page.svelte b/src/routes/projects/+page.svelte index 0e68829..e69de29 100644 --- a/src/routes/projects/+page.svelte +++ b/src/routes/projects/+page.svelte @@ -1,26 +0,0 @@ -
- -

Our projects:

- - -

Nørrebro Skakklubs website

-
- - NBskak - -
- - -
- - diff --git a/src/routes/projects/[project]/+page.svelte b/src/routes/projects/[project]/+page.svelte new file mode 100644 index 0000000..6f8ae4f --- /dev/null +++ b/src/routes/projects/[project]/+page.svelte @@ -0,0 +1,9 @@ + + +
+

{data.title}

+ +
\ No newline at end of file diff --git a/src/routes/projects/[project]/+page.ts b/src/routes/projects/[project]/+page.ts new file mode 100644 index 0000000..2877ca3 --- /dev/null +++ b/src/routes/projects/[project]/+page.ts @@ -0,0 +1,23 @@ +import { error } from '@sveltejs/kit'; +import { languageTag } from '$lib/paraglide/runtime.js'; + +export async function load({ params, depends }) { + const project = params.project; + depends("paraglide:lang"); + + try { + const lang = languageTag(); + const data = (await import(/* @vite-ignore */'../../../lib/projects/' + project + "_" + lang + '.md')); + const metadata = data.metadata; + + return { + content: data.default, + title: metadata.title + } + } catch (e) { + console.error(e); + return error(404, 'Not found'); + } +} + +export const prerender = true; \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index a3b51dc..4289db6 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,11 +1,18 @@ import adapter from '@sveltejs/adapter-cloudflare'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import { mdsvex } from 'mdsvex'; /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors - preprocess: vitePreprocess(), + preprocess: [ + vitePreprocess(), + mdsvex({ + extensions: ['.md'], + }), + ], + extensions: ['.svelte', '.svx', '.md'], kit: { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. @@ -23,6 +30,7 @@ const config = { }, prerender: { origin: 'https://novusgroup.dk', + entries: ['*'], } } };