Skip to content

Commit 390461f

Browse files
cca link
1 parent 015f1d5 commit 390461f

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

_blogposts/2025-03-17-retreats.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ After the retreat, most participants stated that they want to do it again and ov
8484
## Our Sponsors
8585

8686
<Image
87+
externalLink="https://www.cca.io"
8788
src="/static/lp/cca-io-color.svg"
8889
size="small"
8990
caption="Thanks to cca.io for sponsoring our retreat venue"

src/components/Markdown.res

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,13 @@ module Strong = {
474474

475475
module Image = {
476476
@react.component
477-
let make = (~src: string, ~size=#large, ~withShadow=false, ~caption: option<string>=?) => {
477+
let make = (
478+
~src: string,
479+
~size=#large,
480+
~withShadow=false,
481+
~caption: option<string>=?,
482+
~externalLink: option<string>=?,
483+
) => {
478484
let width = switch size {
479485
| #large => "w-full"
480486
| #small => "w-1/4"
@@ -486,8 +492,10 @@ module Image = {
486492
""
487493
}
488494

495+
let target = externalLink->Option.isSome ? Some("_blank") : None
496+
489497
<div className={`mt-8 mb-12 ${size === #large ? "md:-mx-16" : ""}`}>
490-
<a href=src rel="noopener noreferrer">
498+
<a href={externalLink->Option.getOr(src)} rel="noopener noreferrer" ?target>
491499
<img className={width ++ " " ++ shadow} src />
492500
</a>
493501
{switch caption {

src/components/Markdown.resi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ module Image: {
160160
~size: [#large | #small]=?,
161161
~withShadow: bool=?,
162162
~caption: string=?,
163+
~externalLink: string=?,
163164
) => React.element
164165
}
165166

src/components/MarkdownComponents.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ type t = {
1111
@as("Intro")
1212
intro?: React.componentLike<Intro.props<React.element>, React.element>,
1313
@as("Image")
14-
image?: React.componentLike<Image.props<string, [#large | #small], bool, string>, React.element>,
14+
image?: React.componentLike<
15+
Image.props<string, [#large | #small], bool, string, string>,
16+
React.element,
17+
>,
1518
@as("Video")
1619
video?: React.componentLike<Video.props<string, string>, React.element>,
1720
@as("UrlBox")

0 commit comments

Comments
 (0)