-
Can a custom alert type be created with a custom icon and color? What I need: > [!UX]
> Text I think I'm piecing the README together to achieve this:
const myOptions: IOptions = {
alerts: [
{
keyword: 'UX',
icon: '<svg width="16" height="16" viewBox="0 0 16 16"/></svg>',
title: 'Design Recommendation',
},
],
}
const myGithubAlertBuild = (alertOptions, originalChildren) => {
const alert = {
type: 'element',
tagName: 'div',
properties: {
className: [
`markdown-alert-${alertOptions.keyword.toLowerCase()}`,
],
},
children: [
...originalChildren
],
}
return alert
}
Sound about right? |
Beta Was this translation helpful? Give feedback.
Answered by
chrisweb
Jan 30, 2025
Replies: 1 comment 2 replies
-
Yes, both are possible I did not run your code, but it looks right, I assume you use the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is what I do on my blog:
https://github.com/chrisweb/chris.lu/blob/main/next.config.ts#L85