Skip to content

Instantly share code, notes, and snippets.

@rexxars
Last active August 23, 2022 20:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rexxars/8b5fbc7cbdc33604a3b26aa93d831926 to your computer and use it in GitHub Desktop.
Save rexxars/8b5fbc7cbdc33604a3b26aa93d831926 to your computer and use it in GitHub Desktop.
GROQ-hook projection example for Slack Block Kit
{
"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