Skip to content

Commit

Permalink
Merge pull request #9 from gr-im/use-new-version-of-yocaml
Browse files Browse the repository at this point in the history
Use new version of yocaml
  • Loading branch information
xvw authored Aug 13, 2024
2 parents 7c94279 + d5ae4a6 commit a737847
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
7 changes: 3 additions & 4 deletions lib/action/articles.ml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
let run (module R : Sigs.RESOLVER) chain =
Yocaml.Action.write_static_file R.Target.blog
Yocaml.Action.Static.write_file_with_metadata R.Target.blog
(let open Yocaml.Task in
R.track_common_dependencies
>>> Yocaml.Pipeline.track_file R.Source.articles
>>> Yocaml_yaml.Pipeline.read_file_with_metadata
(module Model.Page)
R.Source.blog
>>> first @@ Model.Articles.index chain R.Source.articles
>>> Static.on_metadata @@ Model.Articles.index chain R.Source.articles
>>> Yocaml_omd.content_to_html ()
>>> Yocaml_jingoo.Pipeline.as_template
(module Model.Articles)
(R.Source.template "blog.html")
>>> Yocaml_jingoo.Pipeline.as_template
(module Model.Articles)
(R.Source.template "layout.html")
>>> drop_first ())
(R.Source.template "layout.html"))
2 changes: 1 addition & 1 deletion lib/action/atom.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let run (module R : Sigs.RESOLVER) chain =
Yocaml.Action.write_static_file R.Target.atom
Yocaml.Action.Static.write_file R.Target.atom
(let open Yocaml.Task in
R.track_common_dependencies
>>> Yocaml.Pipeline.track_file R.Source.articles
Expand Down
10 changes: 4 additions & 6 deletions lib/action/chain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ let member (module R : Sigs.RESOLVER) pred_or_succ current_member target_member
~id:(Model.Member.id current_member)
pred_or_succ
in
Yocaml.Action.write_static_file target
Yocaml.Action.Static.write_file_with_metadata target
(let open Yocaml.Task in
R.track_common_dependencies
>>> const target_member
>>> empty_body ()
>>> Yocaml_jingoo.Pipeline.as_template
(module Model.Member)
(R.Source.template "redirect.html")
>>> drop_first ())
(R.Source.template "redirect.html"))

let index (module R : Sigs.RESOLVER) current_member pred succ =
let target = R.Target.member ~id:(Model.Member.id current_member) in
Yocaml.Action.write_static_file target
Yocaml.Action.Static.write_file_with_metadata target
(let open Yocaml.Task in
R.track_common_dependencies
>>> Yocaml.Pipeline.track_file R.Source.members
Expand All @@ -28,8 +27,7 @@ let index (module R : Sigs.RESOLVER) current_member pred succ =
(R.Source.template "member.html")
>>> Yocaml_jingoo.Pipeline.as_template
(module Model.Member_page)
(R.Source.template "layout.html")
>>> drop_first ())
(R.Source.template "layout.html"))

let run (module R : Sigs.RESOLVER) chain =
let member = member (module R) in
Expand Down
9 changes: 8 additions & 1 deletion lib/action/css.ml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
let run (module R : Sigs.RESOLVER) =
Batch_copy.run ~extension:[ "css" ] ~source:R.Source.css ~target:R.Target.css
Yocaml.Action.Static.write_file R.Target.css
(Yocaml.Pipeline.pipe_files ~separator:"\n"
Yocaml.Path.
[
R.Source.css / "fonts.css";
R.Source.css / "reset.css";
R.Source.css / "style.css";
])
5 changes: 2 additions & 3 deletions lib/action/index.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let run (module R : Sigs.RESOLVER) chain =
Yocaml.Action.write_static_file R.Target.index
Yocaml.Action.Static.write_file_with_metadata R.Target.index
(let open Yocaml.Task in
R.track_common_dependencies
>>> Yocaml.Pipeline.track_file R.Source.members
Expand All @@ -13,5 +13,4 @@ let run (module R : Sigs.RESOLVER) chain =
(R.Source.template "index.html")
>>> Yocaml_jingoo.Pipeline.as_template
(module Model.Index)
(R.Source.template "layout.html")
>>> drop_first ())
(R.Source.template "layout.html"))
2 changes: 1 addition & 1 deletion lib/action/opml.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let run (module R : Sigs.RESOLVER) chain =
Yocaml.Action.write_static_file R.Target.ring_opml
Yocaml.Action.Static.write_file R.Target.ring_opml
(let open Yocaml.Task in
R.track_common_dependencies
>>> Yocaml.Pipeline.track_file R.Source.members
Expand Down
2 changes: 1 addition & 1 deletion lib/resolver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Make (R : Sigs.RESOLVABLE) = struct
let atom = Path.(R.target / "atom.xml")
let ring_opml = Path.(opml / "ring.opml")
let members = Path.(R.target / "u")
let css = Path.(R.target / "css")
let css = Path.(R.target / "css" / "style.css")
let fonts = Path.(R.target / "fonts")
let index = Path.(R.target / "index.html")
let images = Path.(R.target / "images")
Expand Down
2 changes: 0 additions & 2 deletions static/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<title>
ring.muhokama.fun{%- if has_page_title %} - {{ page_title }}{%- endif -%}
</title>
<link rel="stylesheet" href="/css/fonts.css" />
<link rel="stylesheet" href="/css/reset.css" />
<link rel="stylesheet" href="/css/style.css" />
</head>
<body>
Expand Down

0 comments on commit a737847

Please sign in to comment.