Commit 82eb2606 authored by Dario Pinto's avatar Dario Pinto
Browse files

add meta, fix R&D, CSS

parent d0416f50
......@@ -88,18 +88,18 @@ let rec handle_block = function
| Html_block (_attr, str) -> handle_html str
| Definition_list (_attr, _attr_def_elt_list) -> ""
let find_preview doc =
let find_preview n doc =
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 n with
| Invalid_argument _s -> str
let preview article_content =
let content = Omd.of_string article_content |> find_preview in
let content = Omd.of_string article_content |> find_preview 300 in
Format.sprintf "%s..." content
(* The code above is used to extract a small preview from the content field of an article type with the help of Omd *)
......@@ -254,21 +254,23 @@ let links_to_home_pages =
{|
<div class="row">
<div class="col-lg-4" align="left">
<h5>
<p class="toplinks">
<img class="" src="/blog/assets/img/icon_home.svg"/>
<a href="/blog">Home</a>
</h5>
</p>
</div>
<div class="col-lg-4" align="center">
<p class="toplinks">
<a href="/blog/feed">
<img class="feed" src="/blog/assets/img/icon_atom_feed.svg"/>
</a>
</p>
</div>
<div class="col-lg-4" align="right">
<h5>
<p class="toplinks">
<img class="" src="/blog/assets/img/icon_categories.svg"/>
<a href="/blog/category">Categories</a>
</h5>
</p>
</div>
</div>
<hr class="featurette-divider"/>|}
......@@ -392,8 +394,9 @@ let given_author ocp_author =
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
( Format.asprintf {|<h1 id="page-title">Articles by %s</h1>%s%a@.|} author
links_to_home_pages pp_blog_posts articles_of_author
, author )
(** [category_home] This is the home page for all available categories on the
Blog, along with number of articles of given category *)
......
......@@ -11,6 +11,11 @@ p img {
max-width: 45em;
}
.toplinks
{
font-size: 1em;
}
h1, h2 {
font-family: "Fontin", serif;
}
......
......@@ -39,78 +39,85 @@
</div>
</div>
<br />
<hr class="featurette-divider">
<h2 class="page-subtitle">
Fundamental Research
</h2>
<br />
<div class="row">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-3">
<img src="assets/img/logo_altergo.png" class="img-fluid rounded card-image"/>
<div class="col-lg-4">
<img src="assets/img/logo_fui.jpg" class="img-fluid rounded card-image" style="max-width:7.5em"/>
</div>
<div class="col-lg-9">
<div class="col-lg-8">
<h3>
Soprano Project <a href="https://anr.fr">[ANR]</a>
SecurOCaml Project <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
</h3>
During this collaborative four years project funded by the French government, OCamlPro has added to Alt-Ergo the ability to verify floating-point computations.
Integrate security features in the OCaml language.
</div>
</div>
In this collaborative three-year project, OCamlPro works with CEA,INRIA, Lexifi, Trust-In-Soft and Safe River to build an environment for the development of security applications in OCaml, in particular auditing tools and static analysers, such as a detector for uncaught-exceptions. OCamlPro’s work is partially funded by the Conseil Général de l’Essonne.
</div>
<div class="col-lg-6">
<div class="row">
<div class="col-lg-3">
<img src="assets/img/logo_ocaml.svg" class="img-fluid rounded card-image"/>
<img src="assets/img/logo_tryocaml.png" class="img-fluid rounded card-image" style="max-width:7em"/>
</div>
<div class="col-lg-9">
<h3>
Vocal Project <a href="https://anr.fr">[ANR]</a>
UCF Project <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
</h3>
During this collaborative four years project funded by the French government, OCamlPro designed and implemented an OCaml library of formally verified modules that may be used in static analyzers and theorem provers.
Developing the TryOCaml platform for OCaml coding in a browser.
</div>
</div>
In this collaborative three-year project, OCamlPro works with the startups Alterway and XWiki, and the academic research laboratories of University Pierre et Marie Curie, and Denis Diderot, to develop a DSL . It is also contributing to the design of MOOC Platforms, including the OCaml MOOC. OCamlPro’s work is partially funded by BPI France.
</div>
</div>
<br />
<div class="row">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-4">
<img src="assets/img/logo_scilab.png" class="img-fluid rounded card-image" style="max-width:9.5em"/>
</div>
<div class="col-lg-8">
<h3>
Project Richelieu <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
</h3>
</div>
</div>
This collaborative two-year R&D project aimed at industrializing and adapting VMKit (based on LLVM) to address the issues of scientific programming languages, particularly in terms of performance thanks to “JIT” compilation. With Scilab Entreprises, Université Pierre et Marie Curie (UPMC) LIP6 research lab, Dassault Aviation, Arcelor Mittal, CNES, Silkan and Inria Saclay as partners, OCamlPro was developing static analysis and partial typing for the Scilab language. OCamlPro’s work was partially funded by the Conseil Général de l’Essonne.
</div>
</div>
<hr class="featurette-divider">
<h2 class="page-subtitle">
Past Projects
Fundamental Research
</h2>
<br />
<div class="row">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-4">
<img src="assets/img/logo_fui.jpg" class="img-fluid rounded card-image" style="max-width:7.5em"/>
<div class="col-lg-3">
<img src="assets/img/logo_altergo.png" class="img-fluid rounded card-image"/>
</div>
<div class="col-lg-8">
<div class="col-lg-9">
<h3>
SecurOCaml Project <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
Soprano Project <a href="https://anr.fr">[ANR]</a>
</h3>
Integrate security features in the OCaml language.
During this collaborative four years project funded by the French government, OCamlPro has added to Alt-Ergo the ability to verify floating-point computations.
</div>
</div>
In this collaborative three-year project, OCamlPro works with CEA,INRIA, Lexifi, Trust-In-Soft and Safe River to build an environment for the development of security applications in OCaml, in particular auditing tools and static analysers, such as a detector for uncaught-exceptions. OCamlPro’s work is partially funded by the Conseil Général de l’Essonne.
</div>
<div class="col-lg-6">
<div class="row">
<div class="col-lg-3">
<img src="assets/img/logo_tryocaml.png" class="img-fluid rounded card-image" style="max-width:7em"/>
<img src="assets/img/logo_ocaml.svg" class="img-fluid rounded card-image"/>
</div>
<div class="col-lg-9">
<h3>
UCF Project <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
Vocal Project <a href="https://anr.fr">[ANR]</a>
</h3>
Developing the TryOCaml platform for OCaml coding in a browser.
During this collaborative four years project funded by the French government, OCamlPro designed and implemented an OCaml library of formally verified modules that may be used in static analyzers and theorem provers.
</div>
</div>
In this collaborative three-year project, OCamlPro works with the startups Alterway and XWiki, and the academic research laboratories of University Pierre et Marie Curie, and Denis Diderot, to develop a DSL . It is also contributing to the design of MOOC Platforms, including the OCaml MOOC. OCamlPro’s work is partially funded by BPI France.
</div>
</div>
<br />
......@@ -139,7 +146,6 @@
<h3>
Dorm Project <a href="https://en.wikipedia.org/wiki/European_Regional_Development_Fund">[ERDF]</a>
</h3>
Developing the TryOCaml platform for OCaml coding in a browser.
</div>
</div>
The goal of this project was to design the next generation of package managers for Java and similar languages. For OCamlPro, the main outcome was the OPAM package manager, who has become the official package manager for the OCaml.
......@@ -147,21 +153,6 @@
</div>
<br />
<div class="row">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-4">
<img src="assets/img/logo_scilab.png" class="img-fluid rounded card-image" style="max-width:9.5em"/>
</div>
<div class="col-lg-8">
<h3>
Project Richelieu <a href="https://fr.wikipedia.org/wiki/Fonds_unique_interminist%C3%A9riel">[FUI]</a>
</h3>
</div>
</div>
This collaborative two-year R&D project aimed at industrializing and adapting VMKit (based on LLVM) to address the issues of scientific programming languages, particularly in terms of performance thanks to “JIT” compilation. With Scilab Entreprises, Université Pierre et Marie Curie (UPMC) LIP6 research lab, Dassault Aviation, Arcelor Mittal, CNES, Silkan and Inria Saclay as partners, OCamlPro was developing static analysis and partial typing for the Scilab language. OCamlPro’s work was partially funded by the Conseil Général de l’Essonne.
</div>
</div>
<hr class="featurette-divider">
......
(executable
(public_name server)
(modules content server template blog blog_content feed error)
(modules content server template blog blog_content feed error meta)
(libraries dream omd ubase markup lambdasoup))
(rule
......
let keywords_l =
[ "ocamlpro"
; "ocaml"
; "state-of-the-art"
; "prototyping"
; "startup studio"
; "software"
; "engineering"
; "r&d"
; "blog"
; "tooling"
; "blockchains"
; "formal methods"
; "trainings"
; "rust"
; "opam"
; "alt-ergo"
; "digodoc"
; "docs"
]
let default_keywords = Dream.html_escape (String.concat ", " keywords_l)
let default_description =
{|OCamlPro tackles complex design challenges (blockchains, Domain Specific Languages) notably with the use of formal methods. For that purpose, we promote the use of state-of-the-art programming languages like OCaml and Rust.|}
let render ~lang ~title ~content =
Template.render_unsafe ~lang ~title ~content:(Dream.html_escape content)
let my_error_template _debug_info suggested_response =
let status = Dream.status suggested_response in
let code = Dream.status_to_int status
and reason = Dream.status_to_string status in
let content = Error.page code reason in
Dream.html (Template.render_unsafe ~lang:"en" ~title:"Oops" ~content)
Dream.html (Template.render_unsafe ~title:"Oops" ~content ())
let asset_loader _root path _request =
match Content.read ("assets/" ^ path) with
......@@ -36,7 +33,10 @@ let given_article path =
Blog.specific_article_header article.title article.authors article.date
article.category article.tags
in
Some (header ^ (Omd.of_string article.content |> Omd.to_html))
Some
( header ^ (Omd.of_string article.content |> Omd.to_html)
, article.tags
, article.authors )
end
let title content =
......@@ -47,6 +47,8 @@ let title content =
with
| Failure _e -> "Harnessing Cutting-Edge Technologies"
let old_to_new = [ ("old", "new") ]
let () =
Dream.run ~interface:"0.0.0.0"
~error_handler:(Dream.error_template my_error_template)
......@@ -60,34 +62,41 @@ let () =
| None -> Dream.empty `Not_Found
| Some content ->
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ()) )
; Dream.get "/blog/category" (fun _request ->
let content = Blog.category_home in
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ()) )
; Dream.get "/blog/category/:cat" (fun request ->
let content = Blog.given_category (Dream.param "cat" request) in
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ()) )
; Dream.get "/blog/authors/:author" (fun request ->
let content = Blog.given_author (Dream.param "author" request) in
let content, authors =
Blog.given_author (Dream.param "author" request)
in
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ~authors ()) )
; Dream.get "/blog/:title" (fun request ->
match given_article (Dream.param "title" request) with
| None -> Dream.empty `Not_Found
| Some content ->
| Some (content, tags, authors) ->
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
let authors = Dream.html_escape (String.concat ", " authors) in
let keywords =
Dream.html_escape (String.concat ", " (tags @ Meta.keywords_l))
in
Dream.html
(Template.render_unsafe ~title ~content ~authors ~keywords ()) )
; Dream.get "/blog" (fun _request ->
let content = Blog.home_page in
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ()) )
; Dream.get "/:page" (fun request ->
match page (Dream.param "page" request) with
| None -> Dream.empty `Not_Found
| Some content ->
let title = title content in
Dream.html (Template.render_unsafe ~lang:"en" ~title ~content) )
Dream.html (Template.render_unsafe ~title ~content ()) )
]
@@ Dream.not_found
let render_unsafe ~lang ~title ~content =
let render_unsafe ~title ~content ?(authors = "OCamlPro") ?(keywords = Meta.default_keywords) ?(description = Meta.default_description) () =
<!DOCTYPE html>
<html lang="<%s lang %>">
<html lang="en">
<head>
<meta charset="utf-8"/>
<title><%s title %> | OCamlPro</title>
<meta name="author" content="<%s! authors %>" />
<meta name="description" content="<%s! description %>" />
<meta name="keywords" content="<%s! keywords %>" />
<link rel="icon" type="image/svg+xml" href="/assets/img/logo_ocp_icon.svg">
<link href="/assets/css/bootstrap.min.css" rel="stylesheet"/>
<link href="/assets/css/prism.css" rel="stylesheet"/>
......
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