diff --git a/package-lock.json b/package-lock.json index a7b303e..0e184db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-static": "^1.0.0-next.50", "@sveltejs/kit": "^1.20.4", + "mdsvex": "^0.11.0", "sass": "^1.69.0", "svelte": "^4.0.5", "svelte-check": "^3.4.3", @@ -678,6 +679,12 @@ "integrity": "sha512-Yg4LkgFYvn1faISbDNWmcAC1XoDT8IoMUFspp5mnagKk+UvD2N0IWt5A7GRdMubsNWqgCLmrkf8rXkzNqb4szA==", "dev": true }, + "node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", + "dev": true + }, "node_modules/acorn": { "version": "8.11.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", @@ -1198,6 +1205,21 @@ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" }, + "node_modules/mdsvex": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.11.0.tgz", + "integrity": "sha512-gJF1s0N2nCmdxcKn8HDn0LKrN8poStqAicp6bBcsKFd/zkUBGLP5e7vnxu+g0pjBbDFOscUyI1mtHz+YK2TCDw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.3", + "prism-svelte": "^0.4.7", + "prismjs": "^1.17.1", + "vfile-message": "^2.0.4" + }, + "peerDependencies": { + "svelte": ">=3 <5" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1407,6 +1429,21 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prism-svelte": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz", + "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ==", + "dev": true + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1831,6 +1868,33 @@ "node": ">=14.0" } }, + "node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vite": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz", diff --git a/package.json b/package.json index 0dfd794..0aba938 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-static": "^1.0.0-next.50", "@sveltejs/kit": "^1.20.4", + "mdsvex": "^0.11.0", "sass": "^1.69.0", "svelte": "^4.0.5", "svelte-check": "^3.4.3", diff --git a/src/MDLayout.svelte b/src/MDLayout.svelte new file mode 100644 index 0000000..d0483bf --- /dev/null +++ b/src/MDLayout.svelte @@ -0,0 +1,9 @@ +
+ +
+ + diff --git a/src/lib/components/ImageGallery.svelte b/src/lib/components/ImageGallery.svelte index 1c1e2f8..9fcc68c 100644 --- a/src/lib/components/ImageGallery.svelte +++ b/src/lib/components/ImageGallery.svelte @@ -5,7 +5,7 @@ import ImageLoader from "$lib/components/common/ImageLoader.svelte"; import { loadImagesFromModule } from "$lib/util"; import { playgroundModules, PlaygroundModule } from "$lib/imageModules"; - import data from "$lib/data/playground.yml"; + import data from "$lib/data/yml/playground.yml"; export let module: PlaygroundModule; let dataTyped: PlaygroundYaml[] = data.images; @@ -34,6 +34,7 @@ {#if !image.filename.includes("-video")} {@const id = parseInt(image.filename) - 1} {@const title = dataTyped[id].title ?? "Untitled"} + {@const date = dataTyped[id].date} {@const isVideo = dataTyped[id].video ?? false} {@const imageData = Object.assign(image, dataTyped[id])} @@ -42,7 +43,7 @@ {:else} @@ -52,7 +53,7 @@ class="item" on:click={() => openModal(GalleryModal, { imageData: imageData })}>
-

{title}
{imageData.date}

+

{title}
{date}

{/if} diff --git a/src/lib/components/timeline/Timeline.svelte b/src/lib/components/timeline/Timeline.svelte index bd2ecb1..fc6bc46 100644 --- a/src/lib/components/timeline/Timeline.svelte +++ b/src/lib/components/timeline/Timeline.svelte @@ -1,6 +1,6 @@ + +Re:STORE banner + +
+ Re:STORE in-game screenshot +
+ + ### Introduction + + RE:Store is an isometric shooter featuring a potion-wielding shopkeeper. When your toy store is taken over by cursed, murderous teddy bears, you must "restore" your store back to its former state with your potions. + + *MEGA Newbies and Vets Game Jam 2021* + +
+
+ +### Game assets + +Re:STORE in-game assets + +Re:STORE ending banner + diff --git a/src/lib/data/yml/archive.yml b/src/lib/data/yml/archive.yml new file mode 100644 index 0000000..477df89 --- /dev/null +++ b/src/lib/data/yml/archive.yml @@ -0,0 +1,9 @@ +# next_id: 2 +projects: + - id: 1 + title: Re:STORE + desc: Your toy shop is suddenly taken over by murderous teddy bears! Use your potions to restore them back to their normal state and save your store. + date: 2021 + slug: /archive/re-store + link: https://jteaaa.itch.io/re-store + link_text: Play the game diff --git a/src/lib/data/playground.yml b/src/lib/data/yml/playground.yml similarity index 100% rename from src/lib/data/playground.yml rename to src/lib/data/yml/playground.yml diff --git a/src/lib/data/projects.yml b/src/lib/data/yml/projects.yml similarity index 100% rename from src/lib/data/projects.yml rename to src/lib/data/yml/projects.yml diff --git a/src/lib/images/md-assets/re-store/alt-banner.png b/src/lib/images/md-assets/re-store/alt-banner.png new file mode 100644 index 0000000..6b529f1 Binary files /dev/null and b/src/lib/images/md-assets/re-store/alt-banner.png differ diff --git a/src/lib/images/md-assets/re-store/assets.png b/src/lib/images/md-assets/re-store/assets.png new file mode 100644 index 0000000..38904e4 Binary files /dev/null and b/src/lib/images/md-assets/re-store/assets.png differ diff --git a/src/lib/images/md-assets/re-store/banner.png b/src/lib/images/md-assets/re-store/banner.png new file mode 100644 index 0000000..8a29101 Binary files /dev/null and b/src/lib/images/md-assets/re-store/banner.png differ diff --git a/src/lib/images/md-assets/re-store/screenshot.png b/src/lib/images/md-assets/re-store/screenshot.png new file mode 100644 index 0000000..c68950b Binary files /dev/null and b/src/lib/images/md-assets/re-store/screenshot.png differ diff --git a/src/lib/scss/markdown.scss b/src/lib/scss/markdown.scss new file mode 100644 index 0000000..26e8aa7 --- /dev/null +++ b/src/lib/scss/markdown.scss @@ -0,0 +1,10 @@ +img { + width: 100%; + margin: 1em 0; +} + +.split { + display: inline-grid; + grid-template-columns: 1fr 1fr; + gap: 3em; +} \ No newline at end of file diff --git a/src/routes/(app)/archive/+page.svelte b/src/routes/(app)/archive/+page.svelte index f2be4f9..91a27e5 100644 --- a/src/routes/(app)/archive/+page.svelte +++ b/src/routes/(app)/archive/+page.svelte @@ -1,5 +1,9 @@ @@ -11,3 +15,10 @@ Older and smaller projects for record-keeping. Game jams, hackathons, and other projects that didn't make the main page.

+ +{#each projects as project} +

{project.title}
{project.date}

+ +
+{/each} diff --git a/src/routes/(app)/archive/[slug]/+page.svelte b/src/routes/(app)/archive/[slug]/+page.svelte new file mode 100644 index 0000000..1c94434 --- /dev/null +++ b/src/routes/(app)/archive/[slug]/+page.svelte @@ -0,0 +1,24 @@ + + + + {data.title} | Milkcee Studios + + +

+ Archive > + {data.title} +

+ +

{data.title}

+

{data.date}

+ + + + diff --git a/src/routes/(app)/archive/[slug]/+page.ts b/src/routes/(app)/archive/[slug]/+page.ts new file mode 100644 index 0000000..5429d56 --- /dev/null +++ b/src/routes/(app)/archive/[slug]/+page.ts @@ -0,0 +1,19 @@ +import { error } from "@sveltejs/kit"; + +/** @type {import('./$types').PageLoad} */ +export async function load({ params }) { + const modules = import.meta.glob("../../../../lib/data/md/*.md"); + const project: any = await modules[ + `../../../../lib/data/md/${params.slug}.md` + ](); + + const { title, date } = project.metadata; + const content = project.default; + + return { + slug: params.slug, + title: title, + date: date, + content: content, + }; +} diff --git a/svelte.config.js b/svelte.config.js index 7b5a72a..7136ae0 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,11 +1,23 @@ import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/kit/vite'; +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'], + layout: { + _: './src/MDLayout.svelte' + }, + }), + ], + + extensions: ['.svelte', '.md'], kit: { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.