toAtomEntry :: Text -> Post -> Atom.Entry
toAtomEntry domain post@Post{..} =
  Atom.Entry
    { Atom.entryId = TL.toStrict (domain <> "/" <> getPath post)
    , Atom.entryTitle = Atom.TextString $ TL.toStrict postTitle
    , Atom.entryUpdated = showDayRfc822 postDate
    , Atom.entryAuthors =
      map (toPerson domain) postAuthors
    , Atom.entryCategories =
      map (tagToCat domain) postTags
    , Atom.entryContent =
      Just $ Atom.HTMLContent $ TL.toStrict $ HR.renderHtml postContent
    , Atom.entryContributor = []
    , Atom.entryLinks =
      [ Atom.nullLink (TL.toStrict $ domain <> "/" <> getPath post)
      ]
    , Atom.entryPublished = Just $ T.pack $ show postDate
    , Atom.entryRights = Nothing
    , Atom.entrySource = Nothing
    , Atom.entrySummary =
      Atom.TextString . TL.toStrict <$> previewSummary postPreview
    , Atom.entryInReplyTo = Nothing
    , Atom.entryInReplyTotal = Nothing
    , Atom.entryAttrs = []
    , Atom.entryOther = []
    }
toAtomEntry :: Text -> Post -> Atom.Entry
toAtomEntry domain post@Post{..} =
  Atom.Entry
    { Atom.entryId = TL.toStrict (domain <> "/" <> getPath post)
    , Atom.entryTitle = Atom.TextString $ TL.toStrict postTitle
    , Atom.entryUpdated = showDayRfc822 postDate
    , Atom.entryAuthors =
      map (toPerson domain) postAuthors
    , Atom.entryCategories =
      map (tagToCat domain) postTags
    , Atom.entryContent =
      Just $ Atom.HTMLContent $ TL.toStrict $ HR.renderHtml postContent
    , Atom.entryContributor = []
    , Atom.entryLinks =
      [ Atom.nullLink (TL.toStrict $ domain <> "/" <> getPath post)
      ]
    , Atom.entryPublished = Just $ T.pack $ show postDate
    , Atom.entryRights = Nothing
    , Atom.entrySource = Nothing
    , Atom.entrySummary =
      Atom.TextString . TL.toStrict <$> previewSummary postPreview
    , Atom.entryInReplyTo = Nothing
    , Atom.entryInReplyTotal = Nothing
    , Atom.entryAttrs = []
    , Atom.entryOther = []
    }
toAtomEntry domain post@Post{..} =
  Atom.Entry
    { Atom.entryId = TL.toStrict (domain <> "/" <> getPath post)
    , Atom.entryTitle = Atom.TextString $ TL.toStrict postTitle
    , Atom.entryUpdated = showDayRfc822 postDate
    , Atom.entryAuthors =
      map (toPerson domain) postAuthors
    , Atom.entryCategories =
      map (tagToCat domain) postTags
    , Atom.entryContent =
      Just $ Atom.HTMLContent $ TL.toStrict $ HR.renderHtml postContent
    , Atom.entryContributor = []
    , Atom.entryLinks =
      [ Atom.nullLink (TL.toStrict $ domain <> "/" <> getPath post)
      ]
    , Atom.entryPublished = Just $ T.pack $ show postDate
    , Atom.entryRights = Nothing
    , Atom.entrySource = Nothing
    , Atom.entrySummary =
      Atom.TextString . TL.toStrict <$> previewSummary postPreview
    , Atom.entryInReplyTo = Nothing
    , Atom.entryInReplyTotal = Nothing
    , Atom.entryAttrs = []
    , Atom.entryOther = []
    }