Last active
August 23, 2022 20:41
-
-
Save rexxars/8b5fbc7cbdc33604a3b26aa93d831926 to your computer and use it in GitHub Desktop.
GROQ-hook projection example for Slack Block Kit
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
{ | |
"blocks": [ | |
{ | |
"type": "header", | |
"text": { | |
"type": "plain_text", | |
"text": coalesce(title, "Untitled article"), | |
"emoji": true | |
} | |
}, | |
...body[] { | |
_type == "block" => { | |
"type": "section", | |
"text": { | |
"type": "plain_text", | |
"text": pt::text(@), | |
"emoji": true | |
} | |
}, | |
_type == "image" => { | |
"type": "image", | |
"title": { | |
"type": "plain_text", | |
"text": coalesce(caption, alt, asset->originalFilename, "-"), | |
"emoji": true | |
}, | |
"image_url": asset->url, | |
"alt_text": coalesce(alt, '') | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment