Module B0_github.Pages

module Pages: sig .. end

Publish to GitHub pages.


Updating GitHub pages

type update 

The type for updates.

val update : ?follow_symlinks:bool ->
src:B0_std.Fpath.t option -> B0_std.Fpath.t -> update

update ~follow_symlinks ~src dst is an update that given a relative path dst in the work tree that may not exist:

Use . for dst to denote the root of the work tree; for example update ~src:(Some dir) (Fpath.v ".") replaces the whole website by the file hierarchy rooted at dir.

val nojekyll : update

nojekyll is update ~src:(Some Os.File.null) (Fpath.v ".nojekyll"). Add this to the updtaes to prevent the Jekyll processing that is automatically performed on GitHub pages.

val default_branch : B0_vcs.Git.branch

default_branch is "gh-pages", GitHub's default publication branch for GitHub pages.

val commit_updates : ?allow_hardlinks:bool ->
?log:B0_std.Log.level ->
?branch:B0_vcs.Git.branch ->
B0_vcs.t ->
amend:bool ->
force:bool ->
remote:B0_vcs.Git.remote ->
msg:string -> update list -> (bool, string) Stdlib.result

commit_updates vcs ~log ~remote ~branch ~msg us updates branch (defaults to gh-pages) on remote according to updates us with commit message msg. Ok false is returned if there was nothing to update.

More precisely this:

  1. Fetches remote/branch if it exists.
  2. Creates a transient checkout with a temporary workdir in Os.Dir.default_tmp and a branch called _b0-update-gh-pages reset to remote/branch.
  3. Commits changes with message msg according to us which are applied in order, see B0_github.Pages.update.
  4. Destroys the transient checkout
  5. Pushes _b0-update-gh-pages on remote/branch
  6. Destroys the branch _b0-update-gh-pages

Warning. If you have paths that start with _ GitHub pages won't publish them. You can disable this by adding a .nojekyll file at the root the gh-page branch, see B0_github.Pages.nojekyll.