mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
Seperate Markdown content in its own island
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
This commit is contained in:
parent
5b9a559b51
commit
45409382db
3 changed files with 18 additions and 10 deletions
|
@ -6,7 +6,7 @@ import * as $0 from "./routes/_404.tsx";
|
|||
import * as $1 from "./routes/_app.tsx";
|
||||
import * as $2 from "./routes/index.tsx";
|
||||
import * as $$0 from "./islands/CounterCard.tsx";
|
||||
import * as $$1 from "./components/Footer.tsx";
|
||||
import * as $$1 from "./islands/MarkdownContent.tsx";
|
||||
|
||||
const manifest = {
|
||||
routes: {
|
||||
|
@ -16,7 +16,7 @@ const manifest = {
|
|||
},
|
||||
islands: {
|
||||
"./islands/CounterCard.tsx": $$0,
|
||||
"./islands/Footer.tsx": $$1,
|
||||
"./islands/MarkdownContent.tsx": $$1,
|
||||
},
|
||||
baseUrl: import.meta.url,
|
||||
};
|
||||
|
|
14
islands/MarkdownContent.tsx
Normal file
14
islands/MarkdownContent.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { CSS, render } from "$gfm";
|
||||
|
||||
export default function MarkdownContent({ mdData }: { mdData: string }) {
|
||||
return (
|
||||
<div class="px-4 py-8 aspect-square mx-8 my-8 bg-white items-center justify-center">
|
||||
<style dangerouslySetInnerHTML={{ __html: CSS }} />
|
||||
<div
|
||||
class="markdown-body"
|
||||
dangerouslySetInnerHTML={{ __html: render(mdData) }}
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -2,6 +2,7 @@ import { Handlers } from "$fresh/server.ts";
|
|||
import Counter from "../islands/CounterCard.tsx";
|
||||
import { CSS, render } from "$gfm";
|
||||
import { getGlobalStatistics, setGlobalStatistics } from "../shared/db.ts";
|
||||
import MarkdownContent from "../islands/MarkdownContent.tsx";
|
||||
|
||||
// TODO: This is hardcoded for now, but /assets/audio contains an N amount of files per language
|
||||
// and we want to randomly play one of them when the mascot is squished
|
||||
|
@ -97,14 +98,7 @@ export default function Home(
|
|||
audioFiles={kuruAudio}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4 py-8 aspect-square mx-8 my-8 bg-white items-center justify-center">
|
||||
<style dangerouslySetInnerHTML={{ __html: CSS }} />
|
||||
<div
|
||||
class="markdown-body"
|
||||
dangerouslySetInnerHTML={{ __html: render(mdData) }}
|
||||
>
|
||||
</div>
|
||||
<MarkdownContent mdData={mdData} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue