-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Block #159
Comments
Since DatoCMS already has good support for code inside of Structured Text (including languages and syntax highlighting), we can use that, and then we don't need to introduce a new Block component. Since the Code component is built-in to Astro, we could use it directly in our implementation of Structured Text for Astro: ---
import type { Code as CodeNode } from 'datocms-structured-text-utils';
import { Code } from 'astro:components';
interface Props {
node: CodeNode;
}
const { node } = Astro.props;
const { code, language } = node;
---
<Code code={ code } lang={ language } /> |
The only reason to still introduce a new Code Block in DatoCMS would be to configure |
Also add support for the
Can be mapped with to Shiki's |
Astro provides a built-in Code component that we could easily use to introduce a Code Block component.
Questions
Textblock/Text.astro
.The text was updated successfully, but these errors were encountered: