Merge pull request 'Fix the RSS generation and delete the last reference of my blog' (#2) from fix-rss into main
Reviewed-on: #2
This commit is contained in:
commit
9c1c28a4ef
2 changed files with 11 additions and 4 deletions
13
src/model.ml
13
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 =
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
<a class="small-button github" href="https://github.com/dinosaure">github/dinosaure</a>
|
||||
<a class="small-button twitter" href="https://twitter.com/Dinoosaure">@Dinoosaure</a>
|
||||
<a class="small-button rss" href="./feed.xml">RSS</a>
|
||||
|
||||
{%- autoescape false -%}
|
||||
|
|
Loading…
Reference in a new issue