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

Fall Back to Entry id if Entry Links Do Not Exist #11

Merged
merged 1 commit into from Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/post.ml
Expand Up @@ -163,7 +163,13 @@ let post_of_atom ~(feed : Feed.t) (e : Syndic.Atom.entry) =
(List.find (fun l -> l.Syndic.Atom.rel = Syndic.Atom.Alternate) e.links)
.href
with Not_found -> (
match e.links with l :: _ -> Some l.href | [] -> None)
match e.links with
| l :: _ -> Some l.href
| [] -> (
match Uri.scheme e.id with
| Some "http" -> Some e.id
| Some "https" -> Some e.id
| _ -> None))
in
let date =
match e.published with Some _ -> e.published | None -> Some e.updated
Expand Down