From fdec0c77e9220d347cd511bab169fac3c6d29a7f Mon Sep 17 00:00:00 2001
From: not-nullptr <62841684+not-nullptr@users.noreply.github.com>
Date: Wed, 16 Apr 2025 21:56:15 +0100
Subject: [PATCH] feat: ready for bytecrush!
---
.npmignore | 3 +
package.json | 2 +-
src/lib/converters/pandoc.svelte.ts | 1 +
src/{ => lib/css}/app.scss | 0
src/lib/sections/about/Donate.svelte | 155 +++++++++++++++++++++------
src/lib/workers/pandoc.ts | 2 +
src/routes/+layout.svelte | 2 +-
src/routes/about/+page.svelte | 16 ++-
8 files changed, 145 insertions(+), 36 deletions(-)
create mode 100644 .npmignore
rename src/{ => lib/css}/app.scss (100%)
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..00aa253
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,3 @@
+src/routes
+src/app.d.ts
+src/app.html
\ No newline at end of file
diff --git a/package.json b/package.json
index 697d6c9..9f410a7 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "VERT",
+ "name": "vert",
"version": "0.0.1",
"type": "module",
"scripts": {
diff --git a/src/lib/converters/pandoc.svelte.ts b/src/lib/converters/pandoc.svelte.ts
index 108e657..9ff8544 100644
--- a/src/lib/converters/pandoc.svelte.ts
+++ b/src/lib/converters/pandoc.svelte.ts
@@ -65,6 +65,7 @@ export class PandocConverter extends Converter {
public supportedFormats = [
new FormatInfo("docx", true, true),
+ new FormatInfo("xml", true, true),
new FormatInfo("doc", true, true),
new FormatInfo("md", true, true),
new FormatInfo("html", true, true),
diff --git a/src/app.scss b/src/lib/css/app.scss
similarity index 100%
rename from src/app.scss
rename to src/lib/css/app.scss
diff --git a/src/lib/sections/about/Donate.svelte b/src/lib/sections/about/Donate.svelte
index 3c315eb..9817eea 100644
--- a/src/lib/sections/about/Donate.svelte
+++ b/src/lib/sections/about/Donate.svelte
@@ -1,15 +1,58 @@
+
+
{#snippet donor(name: string, amount: number | string, avatar: string)}
@@ -39,59 +82,96 @@
-
+
-
-
-
-
+ {#each presetAmounts as preset}
+
+ {/each}
-
+
-
- Payments and subscription management
are handled through Liberapay
-
-
-
+
@@ -114,9 +194,20 @@
{#each donors as dono}
{@const { name, amount, avatar } = dono}
- {@render donor(name, amount, avatar)}
+ {@render donor(name, amount || "0.00", avatar)}
{/each}
{/if}
+
+
diff --git a/src/lib/workers/pandoc.ts b/src/lib/workers/pandoc.ts
index 246ed86..2f61f02 100644
--- a/src/lib/workers/pandoc.ts
+++ b/src/lib/workers/pandoc.ts
@@ -113,6 +113,8 @@ const formatToReader = (format: Format): string => {
return "rtf";
case ".rst":
return "rst";
+ case ".xml":
+ return "xml";
}
throw new Error(`Unsupported format: ${format}`);
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 31234ed..4d37589 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -16,7 +16,7 @@
dropping,
vertdLoaded,
} from "$lib/store/index.svelte";
- import "../app.scss";
+ import "$lib/css/app.scss";
import { browser } from "$app/environment";
import { page } from "$app/state";
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
index 4f8b67f..67da240 100644
--- a/src/routes/about/+page.svelte
+++ b/src/routes/about/+page.svelte
@@ -8,6 +8,8 @@
import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";
import { GITHUB_API_URL } from "$lib/consts";
import { addToast } from "$lib/store/ToastProvider";
+ import { dev } from "$app/environment";
+ import { page } from "$app/state";
/* interface Donator {
name: string;
@@ -105,6 +107,9 @@
error(["general"], `Error fetching GitHub contributors: ${e}`);
}
});
+
+ // const donationsEnabled = dev || page.url.origin.endsWith("//vert.sh");
+ const donationsEnabled = false;
@@ -118,15 +123,22 @@
>
+ {#if donationsEnabled}
+
+ {/if}
-
+ {#if !donationsEnabled}
+
+ {/if}
-
+ {#if donationsEnabled}
+
+ {/if}