Skip to content
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

don't require email address for feeds #736

Merged
merged 3 commits into from
Feb 11, 2023
Merged

Conversation

robx
Copy link
Contributor

@robx robx commented Oct 29, 2019

(I'm not sure this is the best way to do this, or it's even a good idea to make this optional, feel free to close.)

I found myself wanting to generate an atom.xml without providing an email address. According to RFC 4287, the <email> tag is optional.

This changes feedAuthorEmail from String to Maybe String, and updates the template accordingly.

@@ -120,6 +120,10 @@ renderFeed feedTpl itemTpl config itemContext items = do
StringField s -> return s
_ -> fail "Hakyll.Web.Feed.renderFeed: Internal error"

emailField = case feedAuthorEmail config of
Nothing -> missingField
Just email -> constField "authorEmail" email
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer a new helper

optField : String -> Maybe String -> Context a

used as optField "authorEmail" (feedAuthorEmail config)?

@jaspervdj
Copy link
Owner

I'm generally fine with this idea but I've tried really hard to keep breaking changes at bay. Should we consider just using the empty string as empty? (I sort of hate the idea, but I also hate the idea of breaking everyone's blogs 😔)

@puffnfresh
Copy link
Contributor

@jaspervdj sounds good to me

@jaspervdj jaspervdj merged commit 8b0a398 into jaspervdj:master Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants