Created
July 12, 2025 16:00
-
-
Save mornir/2c45c6c402b0902fd634da70e4b80523 to your computer and use it in GitHub Desktop.
GROQ custom function
This file contains hidden or 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
fn utils::expandLink($lang) = $lang[]{ | |
..., | |
markDefs[]{ | |
..., | |
_type == "internalLink" => { | |
"slug": @.reference->number, | |
"type": @.reference->_type, | |
} | |
} | |
}; | |
*[_type == "title"]{ | |
..., | |
desc { | |
"de": utils::expandLink(de), | |
"fr": utils::expandLink(fr), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment