remove bloat fonts, get rid of svelte-i18n

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-07-24 06:15:19 +03:00
parent bf95c575eb
commit e3692f90b1
53 changed files with 1965 additions and 2616 deletions

View File

@@ -1,50 +1,41 @@
<script>
import Header from "$lib/header.svelte";
import Error from "$lib/error.svelte";
import Head from "$lib/head.svelte";
import Navbar from "$components/navbar.svelte";
import Footer from "$components/footer.svelte";
import Header from "$components/header.svelte";
import Head from "$components/head.svelte";
import { locale, _ } from "$lib/locale.js";
import { locale, _ } from "svelte-i18n";
import { goto } from "$app/navigation";
import { color } from "$lib/util.js";
import DOMPurify from "dompurify";
import { onMount } from "svelte";
import { marked } from "marked";
import { onMount } from "svelte";
let { data } = $props();
marked.use({ breaks: true });
marked.use();
onMount(async () => {
for (let key in data.doc)
onMount(() => {
for (let key in data.doc) {
data.doc[key]["content"] = DOMPurify.sanitize(data.doc[key]["content"]);
if (undefined !== data.error && data.error.includes("not found")) goto("/");
}
});
</script>
<Head title="documentation" desc="website and API documentation" />
<Header picture="reader" title={data.doc[$locale].title} />
{#if data.error.length !== 0}
{#if !data.error.includes("not found")}
<Error error={data.error} />
{/if}
{:else}
<main>
<div class="markdown-body" style="--link-color: var(--{color()})">
{@html marked.parse(data.doc[$locale].content)}
</div>
</main>
{/if}
<Navbar />
<Header picture="reader" title={data.doc[$locale.code].title} />
<main>
<div class="markdown-body">
{@html marked.parse(data.doc[$locale.code].content)}
</div>
</main>
<Footer />
<style>
@import "/css/markdown.css";
main {
padding: 50px;
background: var(--black-1);
padding: 40px;
gap: 30px;
}
main .markdown-body :global(a) {
color: var(--link-color);
}
</style>