Module B0_github.Pages
Publish to GitHub pages.
Updating GitHub pages
val update : ?follow_symlinks:bool -> src:B0_std.Fpath.t option -> B0_std.Fpath.t -> updateupdate ~follow_symlinks ~src dstis an update that given a relative pathdstin the work tree that may not exist:- If
srcisNone, deletesdstin the work tree. - If
srcisSome srcreplacesdstin the work tree by the contents of the file or file hierarchysrc. Iffollow_symlinksistrue(default) symbolic links are followed insrc.
Use
.fordstto denote the root of the work tree; for exampleupdate ~src:(Some dir) (Fpath.v ".")replaces the whole website by the file hierarchy rooted atdir.- If
val nojekyll : updatenojekyll 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.branchdefault_branchis"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.resultcommit_updates vcs ~log ~remote ~branch ~msg usupdatesbranch(defaults togh-pages) onremoteaccording to updatesuswith commit messagemsg.Ok falseis returned if there was nothing to update.- If
amendistrue, the last commit is amended (if any exists) and the author reset rather than a new commit added - If
forceistrue, the various git operations are forced. logindicates a logging level used to monitor progress (defaults toLog.app).- If
allow_hardlinksistrue(default), updates are, if possible hard linked to the working directory rather than copied
More precisely this:
- Fetches
remote/branchif it exists. - Creates a transient checkout with a temporary workdir in
Os.Dir.default_tmp and a branch called_b0-update-gh-pagesreset toremote/branch. - Commits changes with message
msgaccording touswhich are applied in order, see Updating GitHub pages. - Destroys the transient checkout
- Pushes
_b0-update-gh-pagesonremote/branch - 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.nojekyllfile at the root the gh-page branch, seenojekyll.- If