Commit 029f321d authored by Dario Pinto's avatar Dario Pinto
Browse files

rename articles, comply to standards

parent 6623598d
......@@ -42,10 +42,8 @@ let rec handle_inline = function
| Code (_attr, s) -> s
| Hard_break _attr -> " "
| Soft_break _attr -> " "
| Link (_attr, attr_link) ->
Option.value attr_link.title ~default:"[link name]"
| Image (_attr, attr_link) ->
Option.value attr_link.title ~default:"[image name]"
| Link (_attr, attr_link) -> Option.value attr_link.title ~default:""
| Image (_attr, attr_link) -> Option.value attr_link.title ~default:""
| Html (_attr, str) -> handle_html str
let rec handle_block = function
......@@ -69,14 +67,14 @@ let rec handle_block = function
| Definition_list (_attr, _attr_def_elt_list) -> ""
let find_preview doc =
let str = String.concat " "
let str =
String.concat " "
@@ List.filter
(fun x -> x <> "")
(List.map (fun block -> handle_block block) doc)
in
try
String.sub str 0 300
with _exn -> str
try String.sub str 0 300 with
| _exn -> str
let preview article_content =
let content = Omd.of_string article_content |> find_preview in
......@@ -339,7 +337,10 @@ let given_author ocp_author =
article.authors )
articles_by_date
in
let author = List.hd (List.hd articles_of_author).authors in
let authors = (List.hd articles_of_author).authors in
let author =
List.find (fun auth -> String.equal (normalize_url auth) ocp_author) authors
in
Format.asprintf {|<h1 id="page-title">Articles by %s</h1>%s%a@.|} author
links_to_home_pages pp_blog_posts articles_of_author
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment