34 lines
886 B
Plaintext
34 lines
886 B
Plaintext
---
|
|
import DefaultLayout from "../../layouts/DefaultLayout.astro";
|
|
import Markdown from "../../islands/Markdown.jsx";
|
|
import { marked } from "marked";
|
|
import { getDocumentBySlug } from "../../lib/documents";
|
|
import "../../styles/document.css";
|
|
|
|
const { slug } = Astro.params;
|
|
|
|
const doc = slug ? getDocumentBySlug(slug) : null;
|
|
if (!doc || doc.visible !== true) {
|
|
return Astro.redirect("/dokumenty", 302);
|
|
}
|
|
|
|
const html = marked.parse(doc.content);
|
|
---
|
|
|
|
<DefaultLayout title={doc.title} description={doc.description}>
|
|
<section class="f-section">
|
|
<div class="f-section-grid-single">
|
|
<a href="/dokumenty" class="f-document-link">
|
|
← Wróć do dokumentów
|
|
</a>
|
|
|
|
<h1 class="f-section-title">
|
|
{doc.title}
|
|
</h1>
|
|
|
|
<div class="fuz-markdown max-w-none">
|
|
<Markdown text={html} />
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</DefaultLayout> |