Skip to content

Commit

Permalink
atom: add <link rel="alternate" …> for each entry
Browse files Browse the repository at this point in the history
Per atom spec:

> An entry must contain an alternate link if there is no content element.

Make our generator comply by setting a link element for each entry.
  • Loading branch information
frasertweedale authored and blackheaven committed Apr 3, 2024
1 parent 4a87700 commit abee98b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/hsec-tools/src/Security/Advisories/Generate/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ feed advisories =
}
where
toEntry advisory =
Feed.nullEntry
(advisoriesRootUrl <> "/" <> advisoryLink (advisoryId advisory))
( Feed.nullEntry
(toUrl advisory)
(Feed.TextString $ advisorySummary advisory)
(T.pack . iso8601Show $ advisoryModified advisory)
)
{ Feed.entryLinks = [(Feed.nullLink (toUrl advisory)) { Feed.linkRel = Just (Left "alternate") }]
}

toUrl advisory = advisoriesRootUrl <> "/" <> advisoryLink (advisoryId advisory)

renderFeed :: [AdvisoryR] -> Text
renderFeed =
Expand Down

0 comments on commit abee98b

Please sign in to comment.