We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I am inexperienced with Haskell but using Hakyll as an excuse to try and improve at the language.
Is it possible to parse more complex YAML with nested elements, like this:
--- title: Homepage values: - value1: 0 - value2: 5 ---
and use them in templates? If so, could anyone provide an example of how to achieve this?
The text was updated successfully, but these errors were encountered:
So far I have
valuesCtx :: Context String valuesCtx = field "values" $ \item -> do metadata <- getMetadata (itemIdentifier item) trace (show metadata) $ pure () let nestedField = lookupString "values" metadata return $ fromMaybe "none" nestedField Trace output: fromList [("author",String "me"),("published",String "2010-09-06"),("title",String "title"),("values",Array [Object (fromList [("value1",String "aaaaa")]),Object (fromList [("value2",String "bbbbbb")])])]
But obviously this will never work. Is there a way to extract the the array object from the metadata?
I can only see lookupString with the type signature starting String -> Metadata -> ...
lookupString
String -> Metadata -> ...
Sorry, something went wrong.
No branches or pull requests
Hi, I am inexperienced with Haskell but using Hakyll as an excuse to try and improve at the language.
Is it possible to parse more complex YAML with nested elements, like this:
and use them in templates? If so, could anyone provide an example of how to achieve this?
The text was updated successfully, but these errors were encountered: