mdsvex improvements (needs external testing but works on my end)

Signed-off-by: Alexander J <odyssey346@disroot.org>
This commit is contained in:
Alexander J 2022-05-19 17:39:33 +02:00
parent 2f77b99a1f
commit a5010e2caf
3 changed files with 43 additions and 19 deletions

View File

@ -2,11 +2,11 @@ import { defineMDSveXConfig as defineConfig } from "mdsvex";
const config = defineConfig({
extensions: [".svelte.md", ".md", ".svx"],
layout: "./src/lib/content.svelte",
smartypants: {
dashes: "oldschool",
},
remarkPlugins: [],
rehypePlugins: [],
});

38
src/lib/content.svelte Normal file
View File

@ -0,0 +1,38 @@
<script lang="ts">
export let title;
export let description;
export let separator;
import SvelteSeo from 'svelte-seo';
// Enjoy the jank.
if(title === "Project Segfault") {
title = "";
separator = "";
}
else {
separator = "|";
}
</script>
<SvelteSeo
openGraph={{
title: title,
description: description,
type: 'website',
images: [
{
url: 'https://projectsegfau.lt:8448/_matrix/media/r0/download/projectsegfau.lt/HBgjhWUExhKPzbpkpIqQfUkF',
width: 850,
height: 650,
alt: 'Image'
}
]
}}
/>
<svelte:head>
<title>{title} {separator} Project Segfault</title>
</svelte:head>
<div class="mdsvex_content">
<slot />
</div>

View File

@ -4,26 +4,12 @@
import SvelteSeo from "svelte-seo"
</script>
<title>Project Segfault</title>
<svelte:head>
<title>Project Segfault</title>
</svelte:head>
<Header />
<main>
<slot></slot>
</main>
<SvelteSeo
openGraph={{
title: 'Project Segfault',
description: '4 idiots and a Sun server.',
type: 'website',
images: [
{
url: 'https://projectsegfau.lt:8448/_matrix/media/r0/download/projectsegfau.lt/HBgjhWUExhKPzbpkpIqQfUkF',
width: 850,
height: 650,
alt: 'Image'
}
]
}}
/>
</main>