generate valid atom

This commit is contained in:
Dan Frumin 2020-08-29 14:34:38 +02:00
parent e71a904120
commit 3243fc2e81
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
open Post open Post
(* See https://validator.w3.org/feed/ *)
let format_entry ~title ~date ~url ~contents ~author = let format_entry ~title ~date ~url ~contents ~author =
String.concat "" String.concat ""
@ -11,7 +12,7 @@ let format_entry ~title ~date ~url ~contents ~author =
<author> <author>
<name>|}; author; {|</name> <name>|}; author; {|</name>
</author> </author>
<updated>|}; ISO8601.Permissive.string_of_datetime date;{|</updated> <updated>|}; ISO8601.Permissive.string_of_datetimezone (date, 0.) ;{|</updated>
<link href="|}; url ;{|" rel="alternate" /> <link href="|}; url ;{|" rel="alternate" />
<content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">|}; <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">|};
contents; contents;
@ -27,7 +28,7 @@ let format_feed ~title ~subtitle ~author ~feed_url ~site_url ~last_updated ~(ent
<title>|}; title; {|</title> <title>|}; title; {|</title>
<id>|}; feed_url; {|</id> <id>|}; feed_url; {|</id>
<subtitle>|}; subtitle; {|</subtitle> <subtitle>|}; subtitle; {|</subtitle>
<updated>|}; ISO8601.Permissive.string_of_datetime last_updated; {|</updated> <updated>|}; ISO8601.Permissive.string_of_datetimezone (last_updated, 0.); {|</updated>
<link href="|}; feed_url; {|" rel="self"/> <link href="|}; feed_url; {|" rel="self"/>
<link href="|}; site_url; {|"/> <link href="|}; site_url; {|"/>
|}] in |}] in