diff --git a/src/ocamlorg_data/data_intf.ml b/src/ocamlorg_data/data_intf.ml index 5fa1368525..89dfa7c586 100644 --- a/src/ocamlorg_data/data_intf.ml +++ b/src/ocamlorg_data/data_intf.ml @@ -61,7 +61,6 @@ module Blog = struct authors : string list; date : string; preview_image : string option; - body_html : string; } end diff --git a/tool/ood-gen/lib/blog.ml b/tool/ood-gen/lib/blog.ml index 370c13ab8a..06d5111c0f 100644 --- a/tool/ood-gen/lib/blog.ml +++ b/tool/ood-gen/lib/blog.ml @@ -62,7 +62,7 @@ module Post = struct let all_sources = Source.all () - let of_metadata ~source ~body_html m : Data_intf.Blog.post option = + let of_metadata ~source m : Data_intf.Blog.post option = if Option.value ~default:false m.ignore then None else Some @@ -92,7 +92,6 @@ module Post = struct authors = Option.value ~default:[] m.authors; date = m.date; preview_image = m.preview_image; - body_html; } let pp_meta ppf v = @@ -102,14 +101,10 @@ module Post = struct (metadata_to_yaml v |> Yaml.to_string |> Result.get_ok ~error:(fun (`Msg m) -> Exn.Decode_error m)) - let decode (fpath, (head, body_md)) = + let decode (fpath, (head, _)) = let metadata = metadata_of_yaml head |> Result.map_error (Utils.where fpath) in - let body_html = - body_md |> Markdown.Content.of_string - |> Markdown.Content.render ~syntax_highlighting:true - in let source = match Str.split (Str.regexp_string "/") fpath with | _ :: second :: _ -> ( @@ -128,7 +123,7 @@ module Post = struct in metadata |> Result.map_error (Utils.where fpath) - |> Result.map (of_metadata ~source ~body_html) + |> Result.map (of_metadata ~source) let all () : Data_intf.Blog.post list = Utils.map_md_files decode "planet/*/*.md" @@ -187,7 +182,7 @@ module Scraper = struct ignore = None; } in - let s = Format.asprintf "%a\n%s\n" Post.pp_meta metadata content in + let s = Format.asprintf "%a" Post.pp_meta metadata in let oc = open_out output_file in Printf.fprintf oc "%s" s; close_out oc) diff --git a/tool/ood-gen/lib/planet.ml b/tool/ood-gen/lib/planet.ml index 25f3060b6a..84e86d01c6 100644 --- a/tool/ood-gen/lib/planet.ml +++ b/tool/ood-gen/lib/planet.ml @@ -105,7 +105,9 @@ module GlobalFeed = struct ()) let entry_of_post (post : Blog.post) = - let content = Syndic.Atom.Html (None, post.body_html) in + let content = + Syndic.Atom.Html (None, Option.value post.description ~default:"") + in let url = Uri.of_string post.source.url in let source : Syndic.Atom.source = Syndic.Atom.source ~authors:[] ~id:url