Upgrade to the unreleased version of YOCaml 2 #2
Loading…
Reference in a new issue
No description provided.
Delete branch "yocaml2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/cc @hannes /cc @reynir This is the upgrade to yocaml 2. The main diff is the multi-stage generation. All the blog engine is described into
bin/blog.ml{,i}
. Then, two tools are available,bin/watch.exe
to see the result &bin/push.exe
which pushes the commit into our repository (gh-pages). The program needs OCaml 5 due tohttpcats
to serve. A PR about that is pending and I hope they will release soon YOCaml 2.I think this is fine, I haven't looked into the details. There's only one thing I stumbled upon: now we pass
--host=https://blog.robur.coop
around, which as far as I can see is used for the links to the stylesheet and atom/rss feed -- previously they were links without host (/css/hl.css
), now they are absolute ones with hostnames (https://blog.robur.coop/css/hl.css
) -- I wonder why such a change is needed.It was mostly due to my organisation. My blog is actually deployed into https://dinosaure.github.io/blogger & https://blog.osau.re/. So I need to change the host for both. I can delete it in this PR for blog.robur.coop as well 👍
I'm as well fine to have the host included tbh, and it seems like it'll be less work when updating yocaml again ;)
This change is big and hard to understand (there's no useful CHANGES for yocaml 2), but please feel free to merge if it works :)
@ -24,4 +24,4 @@
- `tags`
You can specify an `author` (with its `name`, `email` and `link`) or not. By
default, we use `team@robur.coop`. If everything looks good, you can generate
I think by default we first look up author information in git config? I remember looking into this at some point. I think team@robur.coop is only used if neither author is passed nor is it configured in git config.
Ah this might not be the case anymore. I can't tell.
Interesting, I always thought we need to specify the author.. and would be fine if we have to ;)
@ -19,7 +19,6 @@ coauthors:
name: Reynir Björnsson
email: reynir@reynir.dk
link: https://reyn.ir/
contribution: What is this field used for?
:D
@ -5,3 +5,3 @@
<ul class="tags-list">
{%- for tag in tags -%}
<li><a href="/tags/{{ tag }}.html">{{ tag }}</a></li>
<li>{{ tag }}</li>
Are these still links? It's not clear to me how they are links now.
It's a step backwards since our first version. We need to develop a way of regenerating tags according to articles with YOCaml 2 (and thus reproduce the same links). This is feasible but requires a lot of work.
Ok, that's fine by me. Should we (temporarily) remove the tags then? Or wdyt?
I like the idea to keep them (and keep this date into our markdown files). We can think later about a process to generate tag HTML files.
Sorry I meant to temporarily remove the tags from the output. I definitely think we should keep the tags as meta data. I'm just not sure it's useful to see on the page a list of tags you can't click.
As you wish, I don't have too many opinions on the subject.
@ -0,0 +1,23 @@
(executable
(name watch)
This requires a version of dune more recent than at least 3.14.2 as otherwise it requires a
(modules watch)
stanza. Should we update dune-project and blogger.opam with dune 3.16.0?Yes, for sure!
I tested this on a fork, and to my surprise the remote needs a #branch otherwise it pushes to main (undesirable). So I changed the help text to be more explicit about that. Below is a commit with this, and the only change is new feeds (atom and rss1).
534480737c
I think we should merge this then.
Things that would be nice to have (later):
let run_git_rev_parse default =
let open Bos in
let value = OS.Cmd.run_out
Cmd.(v "git" % "describe" % "--always" % "--dirty"
% "--exclude=*" % "--abbrev=0")
in
match OS.Cmd.out_string value with
| Ok (value, (_, `Exited 0)) -> value
| Ok (value, (run_info, _)) ->
Logs.warn (fun m -> m "Failed to get commit id: %a: %s"
Cmd.pp (OS.Cmd.run_info_cmd run_info)
value);
default
| Error `Msg e ->
Logs.warn (fun m -> m "Failed to get commit id: %s" e);
default