Skip to content
Snippets Groups Projects
Verified Commit 79afb9dc authored by Nicolas Lenz's avatar Nicolas Lenz :snowflake:
Browse files

feat: add link to feed entries

parent 07c12246
No related branches found
No related tags found
No related merge requests found
......@@ -22,11 +22,15 @@ import Control.Concurrent.Async
toEntry :: PandocMonad m => Text -> Page -> m Atom.Entry
toEntry baseUrl page@Page{..} = let Pandoc meta _ = pageDoc in do
html <- renderPageContent page
let link :: Text = baseUrl <> fromMaybe "" (lookupMetaPlain "link" meta)
let entry = Atom.nullEntry
(baseUrl <> fromMaybe "" (lookupMetaPlain "link" meta))
link
(Atom.TextString $ fromMaybe "Untitled" (lookupMetaPlain "title" meta))
timestamp
return entry { Atom.entryContent = Just $ Atom.HTMLContent html }
return entry
{ Atom.entryContent = Just $ Atom.HTMLContent html
, Atom.entryLinks = [ Atom.nullLink link ]
}
where
timestamp :: Atom.Date
timestamp = toText . iso8601Show $ getUpdated page
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment