Created
March 24, 2023 18:35
-
-
Save jasikpark/aaa0e4bbe7d596cd6011cac2268b9591 to your computer and use it in GitHub Desktop.
Imagined example of an SSR endpoint that returns the markdown sent in the request rendered in an Astro page shell as html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import { Markdown } from 'astro-remote'; | |
import MainLayout from "@layouts/MainLayout.astro"; | |
const markdown = Astro.request.headers.get('markdown'); | |
--- | |
<html> | |
<MainLayout> | |
<h1>My ODB post page</h1 | |
<!-- Disallow inline `style` attributes, but allow HTML comments --> | |
<Markdown content={markdown} sanitize={{ dropAttributes: { "style": ["*"] }, allowComments: true }} /> | |
</MainLayout> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment