-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
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
Using render<Feed>WithTemplates Gives Runtime Type Errors/Produces Invalid Binary Feed #1043
Comments
Two updates on this:
The underlying problem was, of course, -- | Generate the Atom Feed
atomFeedRules
:: (HK.Identifier, HK.FeedConfiguration)
-- ^ Feed name and the feed configuration to use.
-> HK.Pattern
-- ^ File pattern to match entries for the atom feed.
-> HK.Rules ()
atomFeedRules (feedName, feedConf) pattern = HK.create [feedName] $ do
HK.route HK.idRoute
HK.compile $ do
(HK.Item _atPath atomTemplate) <- HK.load "templates/atom_template.xml"
(HK.Item _aitPath atomItemTemplate) <- HK.load "templates/atom_item_template.xml"
allPosts <- HK.loadAllSnapshots pattern feedSnapshot
posts <- mapM HK.relativizeUrls . take 10 =<< HK.recentFirst allPosts
let feedCtx =
postCtx
<> HK.field "summary" sanitiseItemHTML
<> HK.bodyField "content"
HK.renderAtomWithTemplates atomTemplate atomItemTemplate feedConf feedCtx posts
where
sanitiseItemHTML :: HK.Item String -> HK.Compiler String
sanitiseItemHTML item =
pure
. TagSoup.innerText
. TagSoup.parseTags
. HK.itemBody
$ item So up to maintainers to close this out as "user error", or if you want to write some documentation examples for usage of I would still recommend "fixing" the atom template to at least pass the "description" into the "" tag. |
Hello! This is potentially a documentation issue, or an issue that's been around since 2019 (hakyll version 4.13.0.0)?
I'm trying to figure out how to pass
Template
types torenderAtomWithTemplates
(though I suspect this also happens withrenderRSSWithTemplates
).The following compiles fine...
However, when actually running this, one of three things happen, and which happens seems to be nondeterministic.
It doesn't build the site, and produces this error:
It also doesn't build the site, but complains about
atom_template.xml
instead.It DOES build, but it generates an invalid
atom_template.xml
??? This is by far the most confusing to me. This produces a binary file, with some control characters and some bits of XML:No idea what's happening here, but this seems to be a bug?
I can't find anyone who's using
renderAtomWithTemplates
orrenderRSSWithTemplates
to work, so I'm extremely curious how to use it. But also, this appears to be some bug.This was all spurred on by the fact that I noticed that the atom feeds incorrectly put the "description" field into the atom
<summary>
element instead of the atom<content>
element. (See RFC4287)The text was updated successfully, but these errors were encountered: