2022-05-10 14:01:07 +00:00
|
|
|
<script lang="ts">
|
2022-05-10 20:37:30 +00:00
|
|
|
import { onMount } from "svelte";
|
|
|
|
export let contentType: string;
|
|
|
|
export let filename: string;
|
|
|
|
export let slug: string;
|
2022-05-10 14:01:07 +00:00
|
|
|
|
2022-05-10 20:37:30 +00:00
|
|
|
let content = "";
|
|
|
|
|
|
|
|
onMount(async () => {
|
|
|
|
const res = await fetch(`/s/${slug}`);
|
|
|
|
content = await res.text();
|
|
|
|
});
|
2022-05-10 14:01:07 +00:00
|
|
|
</script>
|
|
|
|
|
2022-05-10 21:19:31 +00:00
|
|
|
<div class="container" >
|
|
|
|
<header>{filename}</header>
|
2022-05-10 20:37:30 +00:00
|
|
|
<pre><code>{ content }</code></pre>
|
2022-05-10 14:01:07 +00:00
|
|
|
</div>
|
2022-05-10 21:19:31 +00:00
|
|
|
|
|
|
|
<style>
|
|
|
|
code{
|
|
|
|
color: #c9d1d9;
|
|
|
|
}
|
|
|
|
|
|
|
|
pre{
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
header{
|
|
|
|
font-size: 1.5rem;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
color: #58a6ff;
|
|
|
|
border-bottom: solid 1px #1f6feb;
|
|
|
|
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container{
|
|
|
|
border-width: 2px;
|
|
|
|
border-color: #1f6feb;
|
|
|
|
border-style: solid;
|
|
|
|
border-radius: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|