From cb5900d6ef2567148fdce6a29e972c7d2fd6a9e0 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Mon, 13 Nov 2023 19:18:45 +0100 Subject: [PATCH 1/2] Remove the last ref to blog.osau.re --- templates/list_articles.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/list_articles.html b/templates/list_articles.html index cf1a95c..34cabcf 100644 --- a/templates/list_articles.html +++ b/templates/list_articles.html @@ -1,5 +1,3 @@ -github/dinosaure -@Dinoosaure RSS {%- autoescape false -%} From 50fa99b2fede1503bf9ebbc147b2716218a1dc24 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Wed, 15 Nov 2023 11:29:09 +0100 Subject: [PATCH 2/2] Fix the generation of the feed --- src/model.ml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/model.ml b/src/model.ml index a7baf2a..e62346d 100644 --- a/src/model.ml +++ b/src/model.ml @@ -91,10 +91,19 @@ module Article = struct let date { date; _ } = date let tags { tags; _ } = tags + let escape_string str = + let renderer = Cmarkit_renderer.make () in + let buffer = Buffer.create (String.length str) in + let ctx = Cmarkit_renderer.Context.make renderer buffer in + Cmarkit_html.html_escaped_string ctx str; + Buffer.contents buffer + let to_rss_item url article = + let title = escape_string article.article_title in + let description = escape_string article.article_description in Rss.( - Item.make ~title:article.article_title ~link:url ~pub_date:article.date - ~description:article.article_description ~guid:(Guid.link url) ()) + Item.make ~title ~link:url ~pub_date:article.date ~description + ~guid:(Guid.link url) ()) let make article_title article_description tags date title description author co_authors =